mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-29 10:09:25 -04:00
better error checking in spopen signal handler (see 1107524)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1169 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
205dda8d6e
commit
1cd64d081d
2 changed files with 9 additions and 5 deletions
|
|
@ -243,8 +243,12 @@ static int openmax = 0;
|
|||
void
|
||||
popen_timeout_alarm_handler (int signo)
|
||||
{
|
||||
int fh;
|
||||
if (signo == SIGALRM) {
|
||||
kill (childpid[fileno (child_process)], SIGKILL);
|
||||
fh=fileno (child_process);
|
||||
if(fh >= 0){
|
||||
kill (childpid[fh], SIGKILL);
|
||||
}
|
||||
printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
|
||||
timeout_interval);
|
||||
exit (STATE_CRITICAL);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ int spclose (FILE *);
|
|||
RETSIGTYPE popen_timeout_alarm_handler (int);
|
||||
|
||||
extern unsigned int timeout_interval;
|
||||
pid_t *childpid;
|
||||
int *child_stderr_array;
|
||||
FILE *child_process;
|
||||
FILE *child_stderr;
|
||||
pid_t *childpid=NULL;
|
||||
int *child_stderr_array=NULL;
|
||||
FILE *child_process=NULL;
|
||||
FILE *child_stderr=NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue