Bug 837090 - Man page for inet_aton provides incorrect example
Man page for inet_aton provides incorrect example
Product: Fedora
Classification: Fedora
Component: man-pages (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Schiffer
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-07-02 14:11 EDT by W. Michael Petullo
Modified: 2013-02-09 18:40 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-09-25 02:21:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description W. Michael Petullo 2012-07-02 14:11:21 EDT
Description of problem:
The man page for inet_aton provides an incorrect example:

if (inet_aton(argv[1], &addr) == 0) {

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

How reproducible:
Every time

Steps to Reproduce:
1. man inet_aton
2. Compile example from man page to a.out
Actual results:
> ./a.out not-an-ip-address
inet_aton: Success

Expected results:
The example should not recommend using perror. inet_aton is not a system call and perror prints "Success" even on an error. Instead, the example should use fprintf (stderr, ...).

Additional info:
Comment 1 Peter Schiffer 2012-09-19 10:24:17 EDT
rawhide build:
Comment 2 Fedora Update System 2012-09-19 10:37:38 EDT
man-pages-3.42-1.fc18 has been submitted as an update for Fedora 18.
Comment 3 Fedora Update System 2012-09-20 02:01:23 EDT
Package man-pages-3.42-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing man-pages-3.42-1.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-09-20 06:32:25 EDT
man-pages-3.35-3.fc17 has been submitted as an update for Fedora 17.
Comment 5 Fedora Update System 2012-09-20 07:53:35 EDT
man-pages-3.35-4.fc17 has been submitted as an update for Fedora 17.
Comment 6 Fedora Update System 2012-09-25 02:21:57 EDT
man-pages-3.42-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Michael Kerrisk 2013-02-09 18:40:50 EST
I've applied the following upstream:

diff --git a/man3/inet.3 b/man3/inet.3
index c4b3200..51ca844 100644
--- a/man3/inet.3
+++ b/man3/inet.3
@@ -286,7 +286,7 @@ main(int argc, char *argv[])
     if (inet_aton(argv[1], &addr) == 0) {
-        perror("inet_aton");
+        fprintf(stderr, "Invalid address\\n");

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