On 07.10.2016 18:39, Jens Reyer wrote:
From: Michael Gilbert mgilbert@debian.org Signed-off-by: Jens Reyer jre.winesim@gmail.com
libs/port/spawn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libs/port/spawn.c b/libs/port/spawn.c index 97364e7..c1a95a2 100644 --- a/libs/port/spawn.c +++ b/libs/port/spawn.c @@ -55,20 +55,20 @@ int _spawnvp(int mode, const char *cmdname, const char *const argv[]) if (mode == _P_DETACH) { pid = fork();
if (pid == -1) _exit(1);
else if (pid > 0) _exit(0);
if (pid == -1) abort();
else if (pid > 0) return pid;
The _exit() calls are happening from a child process here, so there is nothing to change. In fact, returning to the caller even breaks the code.
Regards, Sebastian
/* else in grandchild */ } signal( SIGPIPE, SIG_DFL ); execvp(cmdname, (char **)argv);
_exit(1);
abort();
}
if (pid == -1) return -1;
- if (mode == _P_OVERLAY) exit(0);
if (mode == _P_OVERLAY) abort();
if (mode == _P_WAIT || mode == _P_DETACH) {