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 | |||
| 174 | Serhan Kiymaz | 174 | Serhan Kiymaz |
| 175 | Gerhard Lausser | 175 | Gerhard Lausser |
| 176 | Jon Vandegrift | 176 | Jon Vandegrift |
| 177 | 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) | |||
| 270 | { | 270 | { |
| 271 | int fh; | 271 | int fh; |
| 272 | if (signo == SIGALRM) { | 272 | if (signo == SIGALRM) { |
| 273 | fh=fileno (child_process); | 273 | if (child_process != NULL) { |
| 274 | if(fh >= 0){ | 274 | fh=fileno (child_process); |
| 275 | kill (childpid[fh], SIGKILL); | 275 | if(fh >= 0){ |
| 276 | } | 276 | kill (childpid[fh], SIGKILL); |
| 277 | printf (_("CRITICAL - Plugin timed out after %d seconds\n"), | 277 | } |
| 278 | printf (_("CRITICAL - Plugin timed out after %d seconds\n"), | ||
| 278 | timeout_interval); | 279 | timeout_interval); |
| 280 | } else { | ||
| 281 | printf (_("CRITICAL - popen timeout received, but no child process\n")); | ||
| 282 | } | ||
| 279 | exit (STATE_CRITICAL); | 283 | exit (STATE_CRITICAL); |
| 280 | } | 284 | } |
| 281 | } | 285 | } |
