Bug 55659 - Command status shown despite format spec
Command status shown despite format spec
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: time (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Florian La Roche
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-04 00:32 EST by jwitford
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-11-04 00:32:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jwitford 2001-11-04 00:32:30 EST
Description of Problem:
If an output format is specified for the time program a non-zero
exit status of the measured program is displayed.
Such information should only be shown when the -v option is used.

Version-Release number of selected component (if applicable):
1.7-14

How Reproducible:
Always

Steps to Reproduce:
1. /usr/bin/time -f %e false
2. 
3. 

Actual Results:
Command exited with non-zero status 1
0.00

Expected Results:
0.00


Additional Information:
Here is a patch:

--- time-1.7/time.c.verbose	Fri Jun 14 05:38:21 1996
+++ time-1.7/time.c	Sun Nov  4 16:21:09 2001
@@ -327,6 +327,8 @@
   unsigned long r;		/* Elapsed real milliseconds.  */
   unsigned long v;		/* Elapsed virtual (CPU) milliseconds.  */
 
+  if (verbose)
+  {
   if (WIFSTOPPED (resp->waitstatus))
     fprintf (fp, "Command stopped by signal %d\n",
 	     WSTOPSIG (resp->waitstatus));
@@ -336,6 +338,7 @@
   else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus))
     fprintf (fp, "Command exited with non-zero status %d\n",
 	     WEXITSTATUS (resp->waitstatus));
+   }
 
   /* Convert all times to milliseconds.  Occasionally, one of these values
      comes out as zero.  Dividing by zero causes problems, so we first
Comment 1 Florian La Roche 2002-01-09 09:42:26 EST
added to 1.7-15 or newer

Thanks,

Florian La Roche

Note You need to log in before you can comment on or make changes to this bug.