summaryrefslogtreecommitdiffstats
path: root/usr.bin/xargs/xargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/xargs/xargs.c')
-rw-r--r--usr.bin/xargs/xargs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index c69a23a..c56ab60 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -166,15 +166,11 @@ main(int argc, char *argv[])
oflag = 1;
break;
case 'P':
- maxprocs = strtonum(optarg, 1, INT_MAX, &errstr);
+ maxprocs = strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr)
errx(1, "-P %s: %s", optarg, errstr);
if (getrlimit(RLIMIT_NPROC, &rl) != 0)
errx(1, "getrlimit failed");
- if (*endptr != '\0')
- errx(1, "invalid number for -P option");
- if (maxprocs < 0)
- errx(1, "value for -P option should be >= 0");
if (maxprocs == 0 || maxprocs > rl.rlim_cur)
maxprocs = rl.rlim_cur;
break;
OpenPOWER on IntegriCloud