Improve logging of script exiting.

This commit is contained in:
Roy Marples 2012-11-11 12:19:19 +00:00
parent 9530feed8a
commit 31389eea99
2 changed files with 9 additions and 4 deletions

2
configure vendored
View File

@ -240,7 +240,7 @@ fi
case "$OS" in
linux)
echo "CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600" >>$CONFIG_MK
echo "CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700" >>$CONFIG_MK
echo "SRCS+= if-linux.c if-linux-wireless.c lpf.c" >>$CONFIG_MK
echo "SRCS+= platform-linux.c" >>$CONFIG_MK
echo "LDADD+= -lrt" >>$CONFIG_MK

View File

@ -435,9 +435,14 @@ run_script_reason(const struct interface *iface, const char *reason)
break;
}
}
if (WEXITSTATUS(status) == 127)
syslog(LOG_ERR, "exec_script: %s: WEXITSTATUS %d",
argv[0], WEXITSTATUS(status));
if (WIFEXITED(status)) {
if (WEXITSTATUS(status))
syslog(LOG_ERR,
"exec_script: %s: WEXITSTATUS %d",
argv[0], WEXITSTATUS(status));
} else if (WIFSIGNALED(status))
syslog(LOG_ERR, "exec_sript: %s: %s",
argv[0], strsignal(WTERMSIG(status)));
}
/* Send to our listeners */