aboutsummaryrefslogtreecommitdiff
path: root/plugins/popen.c
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-01-13 12:13:56 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-01-13 12:13:56 +0000
commitde5650f28e4e43a7264913953f95a75d8afe23f0 (patch)
treeabdebc01760bc6b0fabfe43a7aed08c6ab55e765 /plugins/popen.c
parentbe20f98d02ad60637e0092de3d4b48407fa1543f (diff)
downloadmonitoring-plugins-de5650f28e4e43a7264913953f95a75d8afe23f0.tar.gz
change exit status to be POSIX compliant
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@237 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/popen.c')
-rw-r--r--plugins/popen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/popen.c b/plugins/popen.c
index d056904d..d4151e61 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -203,24 +203,24 @@ spclose (FILE * fp)
pid_t pid;
if (childpid == NULL)
- return (-1); /* popen() has never been called */
+ return (1); /* popen() has never been called */
fd = fileno (fp);
if ((pid = childpid[fd]) == 0)
- return (-1); /* fp wasn't opened by popen() */
+ return (1); /* fp wasn't opened by popen() */
childpid[fd] = 0;
if (fclose (fp) == EOF)
- return (-1);
+ return (1);
while (waitpid (pid, &stat, 0) < 0)
if (errno != EINTR)
- return (-1); /* error other than EINTR from waitpid() */
+ return (1); /* error other than EINTR from waitpid() */
if (WIFEXITED (stat))
return (WEXITSTATUS (stat)); /* return child's termination status */
- return (STATE_UNKNOWN);
+ return (1);
}
#ifdef OPEN_MAX