Date: Fri, 24 Feb 2012 12:35:17 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232108 - head/usr.bin/xargs Message-ID: <201202241235.q1OCZH2U059017@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Fri Feb 24 12:35:17 2012 New Revision: 232108 URL: http://svn.freebsd.org/changeset/base/232108 Log: xargs: If a utility exits with 255 or a signal, write an error message. If a utility called by xargs exits with status 255 or because of a signal, POSIX requires writing an error message. PR: 165155 Submitted by: Matthew Story matthewstory gmail com Modified: head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Fri Feb 24 12:32:50 2012 (r232107) +++ head/usr.bin/xargs/xargs.c Fri Feb 24 12:35:17 2012 (r232108) @@ -281,7 +281,7 @@ parse_input(int argc, char *argv[]) case EOF: /* No arguments since last exec. */ if (p == bbp) { - waitchildren(*argv, 1); + waitchildren(*av, 1); exit(rval); } goto arg1; @@ -368,7 +368,7 @@ arg2: } prerun(argc, av); if (ch == EOF || foundeof) { - waitchildren(*argv, 1); + waitchildren(*av, 1); exit(rval); } p = bbp; @@ -608,8 +608,11 @@ waitchildren(const char *name, int waita * If utility signaled or exited with a value of 255, * exit 1-125. */ - if (WIFSIGNALED(status) || WEXITSTATUS(status) == 255) - exit(1); + if (WIFSIGNALED(status)) + errx(1, "%s: terminated with signal %d, aborting", + name, WTERMSIG(status)); + if (WEXITSTATUS(status) == 255) + errx(1, "%s: exited with status 255, aborting", name); if (WEXITSTATUS(status)) rval = 1; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202241235.q1OCZH2U059017>