-w was added recently. The change in behavior so we now always fork
means that it's needed in more cases too: other implementations of
setsid(1) only fork if getpgrp() != getpid(). This broke a script, which
is what made me notice the missing help.
This seems to have been an accidental change, and is contrary to what
the util-linux setsid(1) man page says: "The command calls fork(2) if
already a process group leader. Otherwise, it executes a program
in the current process", but whether we change our behavior or not, we
should document the new option.
---
toys/other/setsid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/toys/other/setsid.c b/toys/other/setsid.c
index 57a926ef..70672424 100644
--- a/toys/other/setsid.c
+++ b/toys/other/setsid.c
@@ -14,6 +14,7 @@ config SETSID
-d Detach from tty
-c Control tty (become foreground process & receive keyboard signals)
+ -w Wait for child (and exit with its status)
*/
#define FOR_setsid
--
2.25.0.rc1.283.g88dfdc4193-goog
From 9ce262fb7870653f6a5736834a1eb4c71d21e1e5 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Fri, 10 Jan 2020 16:03:45 -0800
Subject: [PATCH] setsid: document -w.
-w was added recently. The change in behavior so we now always fork
means that it's needed in more cases too: other implementations of
setsid(1) only fork if getpgrp() != getpid(). This broke a script, which
is what made me notice the missing help.
This seems to have been an accidental change, and is contrary to what
the util-linux setsid(1) man page says: "The command calls fork(2) if
already a process group leader. Otherwise, it executes a program
in the current process", but whether we change our behavior or not, we
should document the new option.
---
toys/other/setsid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/toys/other/setsid.c b/toys/other/setsid.c
index 57a926ef..70672424 100644
--- a/toys/other/setsid.c
+++ b/toys/other/setsid.c
@@ -14,6 +14,7 @@ config SETSID
-d Detach from tty
-c Control tty (become foreground process & receive keyboard signals)
+ -w Wait for child (and exit with its status)
*/
#define FOR_setsid
--
2.25.0.rc1.283.g88dfdc4193-goog
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net