From 92005d4291ac03dae4481c72d1549b2f75264cb9 Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sun, 22 Feb 2015 23:26:38 +0100 Subject: [PATCH] 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. --- sbr/execprog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ } -- 1.7.10.4