FreeBSD Bugzilla – Attachment 237367 Details for
Bug 267110
xargs return incorrect exit code when run in parallel mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to xargs and tests
file_267110.txt (text/plain), 2.04 KB, created by
Du Liu
on 2022-10-16 05:32:48 UTC
(
hide
)
Description:
patch to xargs and tests
Filename:
MIME Type:
Creator:
Du Liu
Created:
2022-10-16 05:32:48 UTC
Size:
2.04 KB
patch
obsolete
>diff --git a/usr.bin/xargs/tests/regress.sh b/usr.bin/xargs/tests/regress.sh >index 72458a42d77..bf59e53c867 100644 >--- a/usr.bin/xargs/tests/regress.sh >+++ b/usr.bin/xargs/tests/regress.sh >@@ -1,6 +1,6 @@ > # $FreeBSD$ > >-echo 1..16 >+echo 1..20 > > REGRESSION_START($1) > >@@ -21,4 +21,9 @@ REGRESSION_TEST(`0L', `xargs -0 -L2 echo <${SRCDIR}/regress.0.in') > REGRESSION_TEST(`0P1', `xargs -0 -P1 echo <${SRCDIR}/regress.0.in') > REGRESSION_TEST(`quotes', `xargs -n1 echo <${SRCDIR}/regress.quotes.in') > >+REGRESSION_TEST_FREEFORM(`parallel1', `echo / / | xargs -n1 -P2 test -d; [ $? = 0 ]') >+REGRESSION_TEST_FREEFORM(`parallel2', `echo / /foo | xargs -n1 -P2 test -d; [ $? = 1 ]') >+REGRESSION_TEST_FREEFORM(`parallel3', `echo /foo / | xargs -n1 -P2 test -d; [ $? = 1 ]') >+REGRESSION_TEST_FREEFORM(`parallel4', `echo /foo /bar | xargs -n1 -P2 test -d; [ $? = 1 ]') >+ > REGRESSION_END() >diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c >index 7b664cfde1c..21455e7be26 100644 >--- a/usr.bin/xargs/xargs.c >+++ b/usr.bin/xargs/xargs.c >@@ -315,8 +315,10 @@ parse_input(int argc, char *argv[]) > switch (ch = getchar()) { > case EOF: > /* No arguments since last exec. */ >- if (p == bbp) >- xexit(*av, rval); >+ if (p == bbp) { >+ waitchildren(*av, 1); >+ exit(rval); >+ } > goto arg1; > case ' ': > case '\t': >@@ -406,8 +408,10 @@ arg1: if (insingle || indouble) { > *xp++ = *avj; > } > prerun(argc, av); >- if (ch == EOF || foundeof) >- xexit(*av, rval); >+ if (ch == EOF || foundeof) { >+ waitchildren(*av, 1); >+ exit(rval); >+ } > p = bbp; > xp = bxp; > count = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 267110
: 237367