Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Oct 2022 05:07:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 267110] xargs return incorrect exit code when run in parallel mode
Message-ID:  <bug-267110-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267110

            Bug ID: 267110
           Summary: xargs return incorrect exit code when run in parallel
                    mode
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          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-267110-227>