[PATCH 05/10] setsid: fix argument count bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The below demonstrates what happen before this change.

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

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 sys-utils/setsid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/setsid.c b/sys-utils/setsid.c
index adc34ec..bb089df 100644
--- a/sys-utils/setsid.c
+++ b/sys-utils/setsid.c
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
 			usage(stderr);
 		}
 
-	if (argc < 2)
+	if (argc - optind < 1)
 		usage(stderr);
 
 	if (getpgrp() == getpid()) {
-- 
2.7.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux