From 847bcb63b541e4fbbfa3dccfe3022745cbe9a06a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 23 Sep 2015 22:18:22 -0500 Subject: 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. --- toys/other/setsid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys/other/setsid.c') 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); -- cgit v1.2.3