Bug 199174 - top returns with exit code 1 even if no error occurs
top returns with exit code 1 even if no error occurs
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: procps (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Brian Brock
http://bugs.donarmstrong.com/cgi-bin/...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-17 14:30 EDT by Alexander Dupuy
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-27 10:51:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix top exit code returns (282 bytes, patch)
2006-07-17 14:30 EDT, Alexander Dupuy
no flags Details | Diff

  None (edit)
Description Alexander Dupuy 2006-07-17 14:30:28 EDT
Description of problem:

top returns with exit code 1 even if there were no problems; it should return
exit code 0.

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

procps-3.2.6-3.5 (goes back to FC4 releases as well, FC3 is fine)

How reproducible:

Extremely

Steps to Reproduce:
1.top -b -n 1 > /dev/null; echo $?
  
Actual results:

1

Expected results:

0

Additional info:
Provided URL of Debian bug report, including following patch:

--- top.c.orig	2006-03-30 18:11:43.000000000 +0200
+++ top.c	2006-03-30 18:13:18.000000000 +0200
@@ -408,7 +408,7 @@ static void end_pgm (int dont_care_sig) 
 static void end_pgm (int dont_care_sig)
 {
    (void)dont_care_sig;
-   bye_bye(stdout, 1, NULL);
+   bye_bye(stdout, 0, NULL);
 }
 
A slightly modified version (small line-number offset) suitable for use with FC5
updates, is attached.
Comment 1 Alexander Dupuy 2006-07-17 14:30:29 EDT
Created attachment 132567 [details]
patch to fix top exit code returns
Comment 2 Karel Zak 2006-09-27 10:51:00 EDT
The patch has been added to FC6. I don't have feedback from upstream maintainer
(yet?), but I think you're right that it seems strange if the top return same
code for error as for standard end.

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