From: Roy Marples Date: Sun, 11 Nov 2012 12:19:19 +0000 (+0000) Subject: Improve logging of script exiting. X-Git-Tag: v5.99.3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31389eea99b88b88f4ec47a9dd4f0ce04caa8750;p=thirdparty%2Fdhcpcd.git Improve logging of script exiting. --- diff --git a/configure b/configure index 32a4dfd0..a0bee323 100755 --- a/configure +++ b/configure @@ -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 diff --git a/configure.c b/configure.c index 03e24555..eb8155b0 100644 --- a/configure.c +++ b/configure.c @@ -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 */