summaryrefslogtreecommitdiffstats
path: root/usr.bin/xargs
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
committersjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
commit62bb1062226d3ce6a2350808256a25508978352d (patch)
tree22b131dceb13c3df96da594fbaadb693504797c7 /usr.bin/xargs
parent72ab90509b3a51ab361bf710338f2ef44a4e360d (diff)
parent04932445481c2cb89ff69a83b961bdef3d64757e (diff)
downloadFreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip
FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz
Merge from head
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r--usr.bin/xargs/xargs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index e204528..6bd3e9f 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -670,12 +670,14 @@ pids_init(void)
static int
pids_empty(void)
{
+
return (curprocs == 0);
}
static int
pids_full(void)
{
+
return (curprocs >= maxprocs);
}
@@ -709,7 +711,6 @@ findfreeslot(void)
if ((slot = findslot(NOPID)) < 0)
errx(1, "internal error: no free pid slot");
-
return (slot);
}
@@ -721,13 +722,13 @@ findslot(pid_t pid)
for (slot = 0; slot < maxprocs; slot++)
if (childpids[slot] == pid)
return (slot);
-
return (-1);
}
static void
clearslot(int slot)
{
+
childpids[slot] = NOPID;
}
@@ -762,6 +763,7 @@ prompt(void)
static void
usage(void)
{
+
fprintf(stderr,
"usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]\n"
" [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n"
OpenPOWER on IntegriCloud