]> diplodocus.org Git - nmh/commitdiff
Explictly return the exit code, so we can portably guarantee that
authorKen Hornstein <kenh@pobox.com>
Sat, 18 Jan 2014 05:38:39 +0000 (00:38 -0500)
committerKen Hornstein <kenh@pobox.com>
Sat, 18 Jan 2014 05:38:39 +0000 (00:38 -0500)
pidstatus() will return 0 on a successful command execution.

sbr/pidstatus.c

index de1c55c65b55797010c1e7e333eae12e75b62b78..1c1f734896455c19efe4f827a5a2d3b16e72001d 100644 (file)
 # define WCOREDUMP(s) ((s) & 0x80)
 #endif
 
+/*
+ * Return 0 if the command exited with an exit code of zero, a nonzero code
+ * otherwise.
+ *
+ * Print out an appropriate status message we didn't exit with an exit code
+ * of zero.
+ */
+
 int
 pidstatus (int status, FILE *fp, char *cp)
 {
@@ -42,6 +50,7 @@ pidstatus (int status, FILE *fp, char *cp)
                fprintf (fp, "%s: ", cp);
            fprintf (fp, "exit %d\n", signum);
        }
+       return signum;
     } else if (WIFSIGNALED(status)) {
        /* If child process terminated due to receipt of a signal */
        signum = WTERMSIG(status);