diff options
-rw-r--r-- | THANKS.in | 1 | ||||
-rw-r--r-- | plugins/popen.c | 14 |
2 files changed, 10 insertions, 5 deletions
@@ -174,3 +174,4 @@ Rick Frey Serhan Kiymaz Gerhard Lausser Jon Vandegrift +Jason Crawford diff --git a/plugins/popen.c b/plugins/popen.c index f6810691..5da12a02 100644 --- a/plugins/popen.c +++ b/plugins/popen.c @@ -270,12 +270,16 @@ popen_timeout_alarm_handler (int signo) { int fh; if (signo == SIGALRM) { - fh=fileno (child_process); - if(fh >= 0){ - kill (childpid[fh], SIGKILL); - } - printf (_("CRITICAL - Plugin timed out after %d seconds\n"), + if (child_process != NULL) { + fh=fileno (child_process); + if(fh >= 0){ + kill (childpid[fh], SIGKILL); + } + printf (_("CRITICAL - Plugin timed out after %d seconds\n"), timeout_interval); + } else { + printf (_("CRITICAL - popen timeout received, but no child process\n")); + } exit (STATE_CRITICAL); } } |