aboutsummaryrefslogtreecommitdiff
path: root/toys/other/setsid.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-23 22:18:22 -0500
committerRob Landley <rob@landley.net>2015-09-23 22:18:22 -0500
commit847bcb63b541e4fbbfa3dccfe3022745cbe9a06a (patch)
tree35c6fb8b4bdb11e995a95919abfa682ab7c20221 /toys/other/setsid.c
parent712e163bb0956b94c27051d0175e719b92f453ad (diff)
downloadtoybox-847bcb63b541e4fbbfa3dccfe3022745cbe9a06a.tar.gz
Add xvfork() as a static inline and use it from various places.
Note: vfork(), like fork(), can return -1 if too many processes, and we should notice and fail loudly.
Diffstat (limited to 'toys/other/setsid.c')
-rw-r--r--toys/other/setsid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/other/setsid.c b/toys/other/setsid.c
index 59a1d78f..83db044d 100644
--- a/toys/other/setsid.c
+++ b/toys/other/setsid.c
@@ -19,9 +19,9 @@ config SETSID
void setsid_main(void)
{
- while (setsid()<0) if (vfork()) _exit(0);
+ while (setsid()<0) if (xvfork()) _exit(0);
if (toys.optflags) {
- setpgid(0,0);
+ setpgid(0, 0);
tcsetpgrp(0, getpid());
}
xexec(toys.optargs);