aboutsummaryrefslogtreecommitdiff
path: root/miscutils/setsid.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/setsid.c')
-rw-r--r--miscutils/setsid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/miscutils/setsid.c b/miscutils/setsid.c
index 127adf6f2..d7de1f149 100644
--- a/miscutils/setsid.c
+++ b/miscutils/setsid.c
@@ -26,7 +26,8 @@ int setsid_main(int argc UNUSED_PARAM, char **argv)
* Otherwise our PID serves as PGID of some existing process group
* and cannot be used as PGID of a new process group. */
if (getpgrp() == getpid())
- forkexit_or_rexec(argv);
+ if (fork_or_rexec(argv))
+ exit(EXIT_SUCCESS); /* parent */
setsid(); /* no error possible */