xargs: fix exit code when using -P
authorliu-du <duliujimmy@hotmail.com>
Sun, 16 Oct 2022 03:41:54 +0000 (03:41 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Mon, 17 Oct 2022 10:39:04 +0000 (10:39 +0000)
commit0ca740d9a639ab635f5a28be9051d0124a9544a1
tree20400d33bac240c9aa7104429f5e80c61a5652b3
parentb136983a8a786677967b532fe74ae7975deec47b
xargs: fix exit code when using -P

currently when xargs runs in parallel mode (e.g. -P2), it somtimes
incorrectly returns zero exit code.  this commit fix it and also adds
tests.

Reviewed by: mjg
PR: 267110
usr.bin/xargs/tests/regress.sh
usr.bin/xargs/xargs.c