Bug 198903
Summary: | exit codes do not match errno | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Steve Friedman <steve> |
Component: | man-pages | Assignee: | Marcela Mašláňová <mmaslano> |
Status: | CLOSED NOTABUG | QA Contact: | Ben Levenson <benl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4 | CC: | meyering |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | man-pages-2.36-2 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-07-20 11:23:58 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Steve Friedman
2006-07-14 15:10:19 UTC
Example 1 (rm): the info page states: An exit status of zero indicates success, and a nonzero value indicates failure. Nothing is guaranteed except zero or non-zero. -> NOTABUG Example 2 (route): route is not a coreutils program; besides, the man page does not specify any special exit codes so again you only get to rely on zero or non-zero. -> NOTABUG 'man 2 wait' problem: 'rpm -qf $(man -W 2 wait)' shows that the man page comes from the man-pages package. Reassigning. I am quite aware that the man pages does not specify any behavior. However, if the command is called by via system() and then then strerror() is called on the resultant error, a misleading cause is logged. Mark it a feature request and ship it upstream, at least. Additional info: Also, "man 2 wait" indicates for WEXITSTATUS that the return code is the least 8 bits; however, it is actually the bits 16-8 (if lsb is bit 1). Status has range 0-255 and in library used for WEXITSTATUS is written least significant 8 bits. So I think it's OK. If you have some code, where is more bits, send it here please. #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> int main( int argc, char *argv[]) { int retval = system("asdf"); printf("retval=%d=0x%X WEXITSTATUS(retval)=%d\n", retval, retval, WEXITSTATUS(retval)); } This prints out: sh: line 1: asdf: command not found retval=32512=7F00 WEXITSTATUS(retval)=127 Ok, I fixed it. Upstream solved it as not a bug. Changed. |