Bug 55659 - Command status shown despite format spec
Summary: Command status shown despite format spec
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: time
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Florian La Roche
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-04 05:32 UTC by jwitford
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-11-04 05:32:34 UTC
Embargoed:


Attachments (Terms of Use)

Description jwitford 2001-11-04 05:32:30 UTC
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 14:42:26 UTC
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.