guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-7-68-g3ea


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-7-68-g3ea159a
Date: Mon, 15 Feb 2010 17:43:34 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3ea159afc5c476e06148cf5fc2a1fb77267326f6

The branch, master has been updated
       via  3ea159afc5c476e06148cf5fc2a1fb77267326f6 (commit)
       via  3474222a65b7d4cc02b43bcd8abcadbc7ec5258f (commit)
      from  25bc75c4316497c95b1c3fc17f1678ac47d32041 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3ea159afc5c476e06148cf5fc2a1fb77267326f6
Author: Ludovic Courtès <address@hidden>
Date:   Mon Feb 15 18:43:20 2010 +0100

    Add `getaddrinfo' test.
    
    * test-suite/tests/net-db.test ("getaddrinfo")["port 80 with family and
      socket type"]: New test.

commit 3474222a65b7d4cc02b43bcd8abcadbc7ec5258f
Author: Ludovic Courtès <address@hidden>
Date:   Mon Feb 15 18:42:34 2010 +0100

    Use `#f' for `addrinfo:canonname' when it wasn't supplied by getaddrinfo(3).
    
    * libguile/net_db.c (scm_from_addrinfo): Use `#f' when `ai_canonname'
      isn't set.

-----------------------------------------------------------------------

Summary of changes:
 libguile/net_db.c            |    7 +++++--
 test-suite/tests/net-db.test |   11 +++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libguile/net_db.c b/libguile/net_db.c
index ca6dafb..bcba18e 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -1,5 +1,5 @@
 /* "net_db.c" network database support
- * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2009 Free Software 
Foundation, Inc.
+ * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2009, 2010 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
@@ -493,7 +493,10 @@ scm_from_addrinfo (const struct addrinfo *c_ai)
   SCM_SIMPLE_VECTOR_SET (ai, 3, scm_from_int (c_ai->ai_protocol));
   SCM_SIMPLE_VECTOR_SET (ai, 4,
                         scm_from_sockaddr (c_ai->ai_addr, c_ai->ai_addrlen));
-  SCM_SIMPLE_VECTOR_SET (ai, 5, scm_from_locale_string (c_ai->ai_canonname));
+  SCM_SIMPLE_VECTOR_SET (ai, 5,
+                        c_ai->ai_canonname != NULL
+                        ? scm_from_locale_string (c_ai->ai_canonname)
+                        : SCM_BOOL_F);
 
   return ai;
 }
diff --git a/test-suite/tests/net-db.test b/test-suite/tests/net-db.test
index 7364d82..4033053 100644
--- a/test-suite/tests/net-db.test
+++ b/test-suite/tests/net-db.test
@@ -54,6 +54,17 @@
                      #t
                      ai))))
 
+      (pass-if "port 80 with family and socket type"
+        (let ((ai (getaddrinfo #f "80" (logior AI_ADDRCONFIG AI_NUMERICSERV)
+                               AF_UNSPEC SOCK_STREAM)))
+          (and (> (length ai) 0)
+               (fold (lambda (ai ok?)
+                       (let ((sa (addrinfo:addr ai)))
+                         (and ok?
+                              (= (sockaddr:port sa) 80))))
+                     #t
+                     ai))))
+
       (pass-if "no name"
         (catch 'getaddrinfo-error
           (lambda ()


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]