Author: markj
Date: Fri Apr  3 14:03:58 2020
New Revision: 359596
URL: https://svnweb.freebsd.org/changeset/base/359596

Log:
  xargs: Fix exit status expression when a child process fails to exec.
  
  PR:           244327
  Submitted by: thomas.duffy...@alumni.brown.edu
  MFC after:    1 week

Modified:
  head/usr.bin/xargs/xargs.c

Modified: head/usr.bin/xargs/xargs.c
==============================================================================
--- head/usr.bin/xargs/xargs.c  Fri Apr  3 13:57:41 2020        (r359595)
+++ head/usr.bin/xargs/xargs.c  Fri Apr  3 14:03:58 2020        (r359596)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to