Date: Sun, 16 Oct 2022 05:09:15 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267111] xargs returns incorrect exit code when run in parallel mode Message-ID: <bug-267111-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267111 Bug ID: 267111 Summary: xargs returns incorrect exit code when run in parallel mode Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: duliujimmy@hotmail.com when xargs runs in parallel mode (using -P flag), it may sometimes return incorrect exit code.=20 The following code shows current (incorrect) behaviour: /bin directory exis= ts, /foo directory does not exist. `echo /bin /foo | xargs -n1 -P2 test -d` sometimes return 0 sometimes return 1: ``` root@freebsd:~ # test -d /bin root@freebsd:~ # echo $? 0 root@freebsd:~ # test -d /foo root@freebsd:~ # echo $? 1 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 0 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 1 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 0 ``` --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267111-227>