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:
markj 2020-04-03 14:03:58 +00:00
parent 1781f9ef6f
commit ca00d6cb1f

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;