public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/15635] New: getaddrinfo returns EAI_SYSTEM or EAI_NONAME depending on whether nscd is used
@ 2013-06-15 22:20 ludo at gnu dot org
  2013-06-16  3:57 ` [Bug network/15635] " siddhesh at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ludo at gnu dot org @ 2013-06-15 22:20 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=15635

            Bug ID: 15635
           Summary: getaddrinfo returns EAI_SYSTEM or EAI_NONAME depending
                    on whether nscd is used
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: ludo at gnu dot org

This program asks for a non-existent name:

  #include <errno.h>
  #include <netdb.h>
  #include <stdio.h>
  #include <string.h>

  int
  main(int argc, char **argv)
  {
    struct addrinfo c_hints, *c_result;

    memset(&c_hints, 0, sizeof (c_hints));
    const int err = getaddrinfo ("does-not-exist",
                                 NULL,
                                 &c_hints,
                                 &c_result);
    if (err == 0)
      freeaddrinfo (c_result);

    printf("err: %d\n", err);
    printf("errno: %d\n", errno);

    return 0;
  }

When nscd is running, this returns EAI_NONAME (as expected).
When nscd is not running, this returns EAI_SYSTEM with errno == ENOENT.

The discrepancy looks bogus, and EAI_NONAME looks more appropriate.

(Originally reported at
<http://lists.gnu.org/archive/html/guile-devel/2013-06/msg00032.html>.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-13 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-15 22:20 [Bug network/15635] New: getaddrinfo returns EAI_SYSTEM or EAI_NONAME depending on whether nscd is used ludo at gnu dot org
2013-06-16  3:57 ` [Bug network/15635] " siddhesh at redhat dot com
2014-02-16 17:47 ` jackie.rosen at hushmail dot com
2014-05-28 19:45 ` schwab at sourceware dot org
2014-06-13 15:04 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).