Path: csiph.com!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!171.64.64.130.MISMATCH!usenet.stanford.edu!not-for-mail From: Petr Pisar Newsgroups: gnu.utils.bug Subject: [time] POSIX output should not start with "Command exited with non-zero status" line Date: Wed, 8 Nov 2017 16:39:44 +0000 (UTC) Lines: 48 Approved: bug-gnu-utils@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1510160315 2001 208.118.235.17 (8 Nov 2017 16:58:35 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-gnu-utils@gnu.org Envelope-to: bug-gnu-utils@gnu.org X-Injected-Via-Gmane: http://gmane.org/ User-Agent: slrn/1.0.2 (Linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Wed, 08 Nov 2017 11:58:32 -0500 X-BeenThere: bug-gnu-utils@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.utils.bug:2222 The recently released time-1.8 reports a command failure if -q option is not specified. This happens even if -p option is specified: $ ./time-1.8/time -p /usr/bin/false Command exited with non-zero status 1 real 0.00 user 0.00 sys 0.00 I think the first line should not be here when POSIX mode is request with the -p option. POSIX says: If −p is specified, the following format shall be used in the POSIX locale: "real %f\nuser %f\nsys %f\n", , , [...] The implementation may append white space and additional information following the format shown here. The implementation may also prepend a single empty line before the format shown here. In the previous 1.7 release, Fedora patched time to report the command failure only if -v option was specified, so that "time -p" also did not report it. But because 1.8 started to control the command failure with -q option, I feel users will complain that "time -p" from time-1.8 does not behave as prescribed by the POSIX. I'd like to apply this change the corrects it: --- a/src/time.c +++ b/src/time.c @@ -431,7 +431,7 @@ summarize (fp, fmt, command, resp) unsigned long ru; /* Elapsed real microseconds. */ unsigned long vu; /* Elapsed virtual (CPU) microseconds. */ - if (!quiet) + if (!quiet && output_format != posix_format) { if (WIFSTOPPED (resp->waitstatus)) fprintf (fp, "Command stopped by signal %d\n", -- Petr