]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
setsid: fix argument count bug
authorSami Kerola <kerolasa@iki.fi>
Sun, 13 Mar 2016 10:31:44 +0000 (10:31 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Mar 2016 12:15:13 +0000 (13:15 +0100)
The below demonstrates what happen before this change.

$ setsid --wait
setsid: child 3252 did not exit normally: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/setsid.c

index adc34ecb383e90fe4dc6286ce49b8d2cb911e4bd..bb089df21ec8cbdc0a03083b93c5b239846c8302 100644 (file)
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
                        usage(stderr);
                }
 
-       if (argc < 2)
+       if (argc - optind < 1)
                usage(stderr);
 
        if (getpgrp() == getpid()) {