Code

change exit status to be POSIX compliant
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>
Mon, 13 Jan 2003 12:13:56 +0000 (12:13 +0000)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>
Mon, 13 Jan 2003 12:13:56 +0000 (12:13 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@237 f882894a-f735-0410-b71e-b25c423dba1c

plugins/popen.c

index d056904dcd88dcc36225291024c227521888f5e4..d4151e6142338c01933edb69548e987b2b79ed3d 100644 (file)
@@ -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