mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-14 13:27:06 -04:00
SIGALRM could be received before child_process is created (Jason Crawford)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1317 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
91bd5cfc68
commit
4a7401ea71
2 changed files with 10 additions and 5 deletions
|
|
@ -174,3 +174,4 @@ Rick Frey
|
|||
Serhan Kiymaz
|
||||
Gerhard Lausser
|
||||
Jon Vandegrift
|
||||
Jason Crawford
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue