[git commit] setsid: fix broken -c

Denys Vlasenko vda.linux at googlemail.com
Mon Jun 20 21:50:26 UTC 2016


commit: https://git.busybox.net/busybox/commit/?id=7cf45ae10e71d11ca53e7b0220c76562a8045113
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

This did not work: setsid sh -c 'anything'

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/setsid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/setsid.c b/miscutils/setsid.c
index 1b27377..9bddc2f 100644
--- a/miscutils/setsid.c
+++ b/miscutils/setsid.c
@@ -29,7 +29,7 @@ int setsid_main(int argc UNUSED_PARAM, char **argv)
 	unsigned opt;
 
 	opt_complementary = "-1"; /* at least one arg */
-	opt = getopt32(argv, "c");
+	opt = getopt32(argv, "+c"); /* +: stop on first non-opt */
 	argv += optind;
 
 	/* setsid() is allowed only when we are not a process group leader.


More information about the busybox-cvs mailing list