mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
tests: Have `getaddrinfo' test work for Darwin 8.
* doc/ref/posix.texi (Network Databases): Update description of `EAI_NODATA' to mention that Darwin provides it. * libguile/net_db.c (scm_getaddrinfo): Likewise. * test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]: Accept `EAI_NODATA' too. Reported by David Fang <fang@csl.cornell.edu>, see <http://bugs.gnu.org/10684>.
This commit is contained in:
parent
6f63f118ef
commit
1ba05158eb
3 changed files with 22 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
|||
@c -*-texinfo-*-
|
||||
@c This is part of the GNU Guile Reference Manual.
|
||||
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011
|
||||
@c Free Software Foundation, Inc.
|
||||
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007,
|
||||
@c 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
@c See the file guile.texi for copying conditions.
|
||||
|
||||
@node POSIX
|
||||
|
@ -2502,9 +2502,9 @@ Either @var{name} does not resolve for the supplied parameters,
|
|||
or neither @var{name} nor @var{service} were supplied.
|
||||
|
||||
@item EAI_NODATA
|
||||
This non-POSIX error code can be returned on GNU systems when a
|
||||
request was actually made but returned no data, meaning
|
||||
that no address is associated with @var{name}. Error handling
|
||||
This non-POSIX error code can be returned on some systems (GNU
|
||||
and Darwin, at least), for example when @var{name} is known
|
||||
but requests that were made turned out no data. Error handling
|
||||
code should be prepared to handle it when it is defined.
|
||||
|
||||
@item EAI_SERVICE
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* "net_db.c" network database support
|
||||
* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
*
|
||||
* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2006, 2009,
|
||||
* 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
|
@ -590,10 +591,14 @@ SCM_DEFINE (scm_getaddrinfo, "getaddrinfo", 1, 5, 0,
|
|||
"@item EAI_NONAME\n"
|
||||
"Either @var{name} does not resolve for the supplied parameters, "
|
||||
"or neither @var{name} nor @var{service} were supplied.\n\n"
|
||||
|
||||
/* See `sysdeps/posix/getaddrinfo.c' in the GNU libc, and
|
||||
<http://www.opensource.apple.com/source/Libinfo/Libinfo-324.1/lookup.subproj/netdb.h>,
|
||||
for details on EAI_NODATA. */
|
||||
"@item EAI_NODATA\n"
|
||||
"This non-POSIX error code can be returned on GNU systems when a\n"
|
||||
"request was actually made but returned no data, meaning\n"
|
||||
"that no address is associated with @var{name}. Error handling\n"
|
||||
"This non-POSIX error code can be returned on some systems (GNU "
|
||||
"and Darwin, at least), for example when @var{name} is known "
|
||||
"but requests that were made turned out no data. Error handling\n"
|
||||
"code should be prepared to handle it when it is defined.\n\n"
|
||||
"@item EAI_SERVICE\n"
|
||||
"@var{service} was not recognized for the specified socket type.\n\n"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;;; net-db.test --- Test suite for `net-db' -*- mode: scheme; coding: utf-8; -*-
|
||||
;;;; Ludovic Courtès <ludo@gnu.org>
|
||||
;;;;
|
||||
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
||||
;;;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -100,7 +100,11 @@
|
|||
#f))
|
||||
(lambda (key errcode)
|
||||
;; According to POSIX, both error codes are valid (glibc 2.11
|
||||
;; chooses `EAI_SERVICE'; Darwin chooses `EAI_NONAME'.)
|
||||
;; chooses `EAI_SERVICE'; Darwin 8.11.0 chooses the non-POSIX
|
||||
;; `EAI_NODATA', and more recent Darwin versions choose
|
||||
;; `EAI_NONAME'.)
|
||||
(and (or (= errcode EAI_SERVICE)
|
||||
(= errcode EAI_NONAME))
|
||||
(= errcode EAI_NONAME)
|
||||
(and (defined? 'EAI_NODATA)
|
||||
(= errcode EAI_NODATA)))
|
||||
(string? (gai-strerror errcode))))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue