xargs: Fix exit status expression when a child process fails to exec.

PR:		244327
Submitted by:	thomas.duffy.99@alumni.brown.edu
MFC after:	1 week
This commit is contained in:
Mark Johnston 2020-04-03 14:03:58 +00:00
parent c205ac921b
commit ab82560638
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359596

View file

@ -650,7 +650,7 @@ waitchildren(const char *name, int waitall)
if (childerr != 0 && cause_exit == 0) {
errno = childerr;
waitall = 1;
cause_exit = ENOENT ? 127 : 126;
cause_exit = errno == ENOENT ? 127 : 126;
warn("%s", name);
} else if (WIFSIGNALED(status)) {
waitall = cause_exit = 1;