xargs does not properly detect when -P is negative
While testing some other changes, I noticed that the util-test test suite was failing in xargs. Specifically it was failing test 19 which is where we call xargs -P -3. This was happily driving on. I suspect that the code was relying on the idea that strtoul of -3 would fail. Instead, it actually happily converts it to a rather high value when it should be an error.
This instead changes it to check for a signed value and error appropriately. We also properly document what xargs -P 0 means.
Updated by Electric Monk over 1 year ago
- Status changed from New to Closed
commit 7c71d71894ca896e2718a24b51b39b0e5f9c27e6 Author: Robert Mustacchi <firstname.lastname@example.org> Date: 2019-01-16T18:55:22.000Z 10216 xargs does not properly detect when -P is negative Reviewed by: Patrick Mooney <email@example.com> Reviewed by: Jason King <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Reviewed by: Andy Stormont <firstname.lastname@example.org> Reviewed by: Peter Tribble <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>