ps: conditionally enable -T on non-DESKTOP build too
[oweals/busybox.git] / miscutils / setsid.c
index 127adf6f2822cc1bedfd6d4f99e1b51e3742389c..d7de1f149726b179753f6cbf15595a9936a7baa0 100644 (file)
@@ -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 */