From: Philipp Takacs Date: Sun, 22 Feb 2015 22:26:38 +0000 (+0100) Subject: return -1 if fork(2) fails in execprog X-Git-Tag: mmh-0.2-RC1~50 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=92005d4291ac03dae4481c72d1549b2f75264cb9;p=mmh return -1 if fork(2) fails in execprog If fork in execprog fails and return 1 there is now way to different between a proces witch return 1. Thanks Marcin Cieslak for reporting. --- diff --git a/sbr/execprog.c b/sbr/execprog.c index ce38307..f1f03bc 100644 --- a/sbr/execprog.c +++ b/sbr/execprog.c @@ -16,7 +16,7 @@ execprog(char *cmd, char **arg) case -1: /* fork error */ advise("fork", "unable to"); - return 1; + return -1; case 0: /* child */ @@ -30,7 +30,7 @@ execprog(char *cmd, char **arg) return pidXwait(pid, cmd); } - return 1; /* NOT REACHED */ + return -1; /* NOT REACHED */ }