setsid: fix broken -c

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

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-06-20 23:50:26 +02:00
parent e24e88697a
commit 7cf45ae10e

View File

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