gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_4-49-ge1411f8


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_4-49-ge1411f8
Date: Thu, 27 Oct 2011 07:24:29 +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 gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=e1411f865fcd0f40dc1703cf939373e8c1c5fc83

The branch, master has been updated
       via  e1411f865fcd0f40dc1703cf939373e8c1c5fc83 (commit)
       via  8c818a6ba140fe45b7119a934c826f32d8de7256 (commit)
       via  d86ab06220f5148db3a664d5659b4ec3f35d1079 (commit)
      from  482635401b91171259c9a027d0bc2faefb7e8c68 (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 e1411f865fcd0f40dc1703cf939373e8c1c5fc83
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Oct 27 09:25:36 2011 +0200

    win32 fixes by David Hoyt.

commit 8c818a6ba140fe45b7119a934c826f32d8de7256
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Oct 27 09:24:04 2011 +0200

    more builddir fixes.

commit d86ab06220f5148db3a664d5659b4ec3f35d1079
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Oct 27 09:22:50 2011 +0200

    Added recv(), send(), connect() and inet_ntop() gnulib modules.

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

Summary of changes:
 build-aux/config.rpath                          |  136 +++++--------
 doc/examples/Makefile.am                        |    3 +-
 gl/Makefile.am                                  |   39 ++++-
 gl/{tests => }/connect.c                        |    0
 gl/inet_ntop.c                                  |  249 +++++++++++++++++++++++
 gl/m4/gnulib-cache.m4                           |    6 +-
 gl/m4/gnulib-comp.m4                            |   42 ++++-
 gl/m4/inet_ntop.m4                              |   68 ++++++
 gl/{listen.c => recv.c}                         |   10 +-
 gl/{listen.c => send.c}                         |   10 +-
 gl/tests/Makefile.am                            |   36 +++-
 gl/tests/{test-inet_pton.c => test-inet_ntop.c} |   28 ++--
 gl/tests/{test-shutdown.c => test-recv.c}       |   10 +-
 gl/tests/{test-listen.c => test-send.c}         |   10 +-
 src/benchmark.c                                 |    7 +-
 src/benchmark.h                                 |    3 +
 16 files changed, 523 insertions(+), 134 deletions(-)
 rename gl/{tests => }/connect.c (100%)
 create mode 100644 gl/inet_ntop.c
 create mode 100644 gl/m4/inet_ntop.m4
 copy gl/{listen.c => recv.c} (87%)
 copy gl/{listen.c => send.c} (86%)
 copy gl/tests/{test-inet_pton.c => test-inet_ntop.c} (65%)
 copy gl/tests/{test-shutdown.c => test-recv.c} (83%)
 copy gl/tests/{test-listen.c => test-send.c} (82%)

diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index 8bd7f5d..c547c68 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2011 Free Software Foundation, Inc.
+#   Copyright 1996-2007 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #
@@ -47,7 +47,7 @@ for cc_temp in $CC""; do
 done
 cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
 
-# Code taken from libtool.m4's _LT_COMPILER_PIC.
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
 
 wl=
 if test "$GCC" = yes; then
@@ -57,7 +57,14 @@ else
     aix*)
       wl='-Wl,'
       ;;
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
+    darwin*)
+      case $cc_basename in
+        xlc*)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    mingw* | cygwin* | pw32* | os2*)
       ;;
     hpux9* | hpux10* | hpux11*)
       wl='-Wl,'
@@ -65,37 +72,24 @@ else
     irix5* | irix6* | nonstopux*)
       wl='-Wl,'
       ;;
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    newsos6)
+      ;;
+    linux* | k*bsd*-gnu)
       case $cc_basename in
-        ecc*)
+        icc* | ecc*)
           wl='-Wl,'
           ;;
-        icc* | ifort*)
-          wl='-Wl,'
-          ;;
-        lf95*)
-          wl='-Wl,'
-          ;;
-        nagfor*)
-          wl='-Wl,-Wl,,'
-          ;;
-        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        pgcc | pgf77 | pgf90)
           wl='-Wl,'
           ;;
         ccc*)
           wl='-Wl,'
           ;;
-        xl* | bgxl* | bgf* | mpixl*)
-          wl='-Wl,'
-          ;;
         como)
           wl='-lopt='
           ;;
         *)
           case `$CC -V 2>&1 | sed 5q` in
-            *Sun\ F* | *Sun*Fortran*)
-              wl=
-              ;;
             *Sun\ C*)
               wl='-Wl,'
               ;;
@@ -103,24 +97,13 @@ else
           ;;
       esac
       ;;
-    newsos6)
-      ;;
-    *nto* | *qnx*)
-      ;;
     osf3* | osf4* | osf5*)
       wl='-Wl,'
       ;;
     rdos*)
       ;;
     solaris*)
-      case $cc_basename in
-        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-          wl='-Qoption ld '
-          ;;
-        *)
-          wl='-Wl,'
-          ;;
-      esac
+      wl='-Wl,'
       ;;
     sunos4*)
       wl='-Qoption ld '
@@ -141,7 +124,7 @@ else
   esac
 fi
 
-# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
 
 hardcode_libdir_flag_spec=
 hardcode_libdir_separator=
@@ -149,7 +132,7 @@ hardcode_direct=no
 hardcode_minus_L=no
 
 case "$host_os" in
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | mingw* | pw32*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -175,21 +158,22 @@ if test "$with_gnu_ld" = yes; then
   # option of GNU ld is called -rpath, not --rpath.
   hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
   case "$host_os" in
-    aix[3-9]*)
+    aix3* | aix4* | aix5*)
       # On AIX/PPC, the GNU linker is very broken
       if test "$host_cpu" != ia64; then
         ld_shlibs=no
       fi
       ;;
     amigaos*)
-      case "$host_cpu" in
-        powerpc)
-          ;;
-        m68k)
-          hardcode_libdir_flag_spec='-L$libdir'
-          hardcode_minus_L=yes
-          ;;
-      esac
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # Samuel A. Falvo II <address@hidden> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we cannot use
+      # them.
+      ld_shlibs=no
       ;;
     beos*)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@@ -198,7 +182,7 @@ if test "$with_gnu_ld" = yes; then
         ld_shlibs=no
       fi
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | mingw* | pw32*)
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
@@ -208,13 +192,11 @@ if test "$with_gnu_ld" = yes; then
         ld_shlibs=no
       fi
       ;;
-    haiku*)
-      ;;
     interix[3-9]*)
       hardcode_direct=no
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
       ;;
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         :
       else
@@ -272,7 +254,7 @@ else
         hardcode_direct=unsupported
       fi
       ;;
-    aix[4-9]*)
+    aix4* | aix5*)
       if test "$host_cpu" = ia64; then
         # On IA64, the linker does run time linking by default, so we don't
         # have to do anything special.
@@ -282,7 +264,7 @@ else
         # Test if we are trying to use run time linking or normal
         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
         # need to do runtime linking.
-        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
           for ld_flag in $LDFLAGS; do
             if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
               aix_use_runtimelinking=yes
@@ -337,18 +319,14 @@ else
       fi
       ;;
     amigaos*)
-      case "$host_cpu" in
-        powerpc)
-          ;;
-        m68k)
-          hardcode_libdir_flag_spec='-L$libdir'
-          hardcode_minus_L=yes
-          ;;
-      esac
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
       ;;
     bsdi[45]*)
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | mingw* | pw32*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -358,15 +336,24 @@ else
       ;;
     darwin* | rhapsody*)
       hardcode_direct=no
-      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; 
then
+      if test "$GCC" = yes ; then
         :
       else
-        ld_shlibs=no
+        case $cc_basename in
+          xlc*)
+            ;;
+          *)
+            ld_shlibs=no
+            ;;
+        esac
       fi
       ;;
     dgux*)
       hardcode_libdir_flag_spec='-L$libdir'
       ;;
+    freebsd1*)
+      ld_shlibs=no
+      ;;
     freebsd2.2*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -427,8 +414,6 @@ else
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
-    *nto* | *qnx*)
-      ;;
     openbsd*)
       if test -f /usr/libexec/ld.so; then
         hardcode_direct=yes
@@ -509,7 +494,7 @@ else
 fi
 
 # Check dynamic linker characteristics
-# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
 # Unlike libtool.m4, here we don't care about _all_ names of the library, but
 # only about the one the linker finds when passed -lNAME. This is the last
 # element of library_names_spec in libtool.m4, or possibly two of them if the
@@ -520,16 +505,11 @@ case "$host_os" in
   aix3*)
     library_names_spec='$libname.a'
     ;;
-  aix[4-9]*)
+  aix4* | aix5*)
     library_names_spec='$libname$shrext'
     ;;
   amigaos*)
-    case "$host_cpu" in
-      powerpc*)
-        library_names_spec='$libname$shrext' ;;
-      m68k)
-        library_names_spec='$libname.a' ;;
-    esac
+    library_names_spec='$libname.a'
     ;;
   beos*)
     library_names_spec='$libname$shrext'
@@ -537,7 +517,7 @@ case "$host_os" in
   bsdi[45]*)
     library_names_spec='$libname$shrext'
     ;;
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | mingw* | pw32*)
     shrext=.dll
     library_names_spec='$libname.dll.a $libname.lib'
     ;;
@@ -548,6 +528,8 @@ case "$host_os" in
   dgux*)
     library_names_spec='$libname$shrext'
     ;;
+  freebsd1*)
+    ;;
   freebsd* | dragonfly*)
     case "$host_os" in
       freebsd[123]*)
@@ -559,9 +541,6 @@ case "$host_os" in
   gnu*)
     library_names_spec='$libname$shrext'
     ;;
-  haiku*)
-    library_names_spec='$libname$shrext'
-    ;;
   hpux9* | hpux10* | hpux11*)
     case $host_cpu in
       ia64*)
@@ -597,7 +576,7 @@ case "$host_os" in
     ;;
   linux*oldld* | linux*aout* | linux*coff*)
     ;;
-  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  linux* | k*bsd*-gnu)
     library_names_spec='$libname$shrext'
     ;;
   knetbsd*-gnu)
@@ -609,7 +588,7 @@ case "$host_os" in
   newsos6)
     library_names_spec='$libname$shrext'
     ;;
-  *nto* | *qnx*)
+  nto-qnx*)
     library_names_spec='$libname$shrext'
     ;;
   openbsd*)
@@ -640,9 +619,6 @@ case "$host_os" in
   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
     library_names_spec='$libname$shrext'
     ;;
-  tpf*)
-    library_names_spec='$libname$shrext'
-    ;;
   uts4*)
     library_names_spec='$libname$shrext'
     ;;
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 53eb7bd..76afe83 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -24,7 +24,8 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes     \
        -I$(top_srcdir)/extra/includes \
-       -I$(top_srcdir)/gl
+       -I$(top_srcdir)/gl \
+       -I$(top_builddir)/gl
 
 # Gnulib warns and suggests use of fseeko instead of fseek, which is
 # used in ex-cert-select.c, but certificate files will not be > 4 GB,
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 22dc37b..428ee44 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests 
--avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl 
--no-vc-files accept alloca alphasort argp bind byteswap c-ctype close 
crypto/hmac-md5 crypto/md5 error extensions func getpass getsubopt gettext 
gettime havelib inet_pton lib-msvc-compat lib-symbol-versions listen 
maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in progname 
read-file recvfrom scandir select sendto setsockopt shutdown snprintf socket 
sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec 
u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix 
vprintf-posix vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests 
--avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl 
--no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect 
crypto/hmac-md5 crypto/md5 error extensions func getpass getsubopt gettext 
gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen 
maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in progname 
read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf 
socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r 
timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf 
vfprintf-posix vprintf-posix vsnprintf warnings
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -51,6 +51,7 @@ libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
 EXTRA_libgnu_la_SOURCES =
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 libgnu_la_LDFLAGS += -no-undefined
+libgnu_la_LDFLAGS += $(INET_NTOP_LIB)
 libgnu_la_LDFLAGS += $(INET_PTON_LIB)
 libgnu_la_LDFLAGS += $(LIBSOCKET)
 libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
@@ -217,6 +218,15 @@ EXTRA_libgnu_la_SOURCES += closedir.c
 
 ## end   gnulib module closedir
 
+## begin gnulib module connect
+
+
+EXTRA_DIST += connect.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += connect.c
+
+## end   gnulib module connect
+
 ## begin gnulib module crypto/hmac-md5
 
 libgnu_la_SOURCES += hmac-md5.c
@@ -589,6 +599,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
 
 ## end   gnulib module havelib
 
+## begin gnulib module inet_ntop
+
+
+EXTRA_DIST += inet_ntop.c
+
+EXTRA_libgnu_la_SOURCES += inet_ntop.c
+
+## end   gnulib module inet_ntop
+
 ## begin gnulib module inet_pton
 
 
@@ -1035,6 +1054,15 @@ EXTRA_libgnu_la_SOURCES += realloc.c
 
 ## end   gnulib module realloc-posix
 
+## begin gnulib module recv
+
+
+EXTRA_DIST += recv.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += recv.c
+
+## end   gnulib module recv
+
 ## begin gnulib module recvfrom
 
 
@@ -1062,6 +1090,15 @@ EXTRA_libgnu_la_SOURCES += select.c
 
 ## end   gnulib module select
 
+## begin gnulib module send
+
+
+EXTRA_DIST += send.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += send.c
+
+## end   gnulib module send
+
 ## begin gnulib module sendto
 
 
diff --git a/gl/tests/connect.c b/gl/connect.c
similarity index 100%
rename from gl/tests/connect.c
rename to gl/connect.c
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
new file mode 100644
index 0000000..c11b1e0
--- /dev/null
+++ b/gl/inet_ntop.c
@@ -0,0 +1,249 @@
+/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
+
+   Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <config.h>
+
+/* Specification.  */
+#include <arpa/inet.h>
+
+#if HAVE_DECL_INET_NTOP
+
+# undef inet_ntop
+
+const char *
+rpl_inet_ntop (int af, const void *restrict src,
+               char *restrict dst, socklen_t cnt)
+{
+  return inet_ntop (af, src, dst, cnt);
+}
+
+#else
+
+# include <stdio.h>
+# include <string.h>
+# include <errno.h>
+
+# define NS_IN6ADDRSZ 16
+# define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+typedef int verify_int_size[4 <= sizeof (int) ? 1 : -1];
+
+static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t 
size);
+# if HAVE_IPV6
+static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t 
size);
+# endif
+
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ *      convert a network format address to presentation format.
+ * return:
+ *      pointer to presentation format address (`dst'), or NULL (see errno).
+ * author:
+ *      Paul Vixie, 1996.
+ */
+const char *
+inet_ntop (int af, const void *restrict src,
+           char *restrict dst, socklen_t cnt)
+{
+  switch (af)
+    {
+# if HAVE_IPV4
+    case AF_INET:
+      return (inet_ntop4 (src, dst, cnt));
+# endif
+
+# if HAVE_IPV6
+    case AF_INET6:
+      return (inet_ntop6 (src, dst, cnt));
+# endif
+
+    default:
+      errno = EAFNOSUPPORT;
+      return (NULL);
+    }
+  /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ *      format an IPv4 address
+ * return:
+ *      `dst' (as a const)
+ * notes:
+ *      (1) uses no statics
+ *      (2) takes a u_char* not an in_addr as input
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
+{
+  char tmp[sizeof "255.255.255.255"];
+  int len;
+
+  len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
+  if (len < 0)
+    return NULL;
+
+  if (len > size)
+    {
+      errno = ENOSPC;
+      return NULL;
+    }
+
+  return strcpy (dst, tmp);
+}
+
+# if HAVE_IPV6
+
+/* const char *
+ * inet_ntop6(src, dst, size)
+ *      convert IPv6 binary address into presentation (printable) format
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
+{
+  /*
+   * Note that int32_t and int16_t need only be "at least" large enough
+   * to contain a value of the specified size.  On some systems, like
+   * Crays, there is no such thing as an integer variable with 16 bits.
+   * Keep this in mind if you think this function should have been coded
+   * to use pointer overlays.  All the world's not a VAX.
+   */
+  char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+  struct
+  {
+    int base, len;
+  } best, cur;
+  unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+  int i;
+
+  /*
+   * Preprocess:
+   *      Copy the input (bytewise) array into a wordwise array.
+   *      Find the longest run of 0x00's in src[] for :: shorthanding.
+   */
+  memset (words, '\0', sizeof words);
+  for (i = 0; i < NS_IN6ADDRSZ; i += 2)
+    words[i / 2] = (src[i] << 8) | src[i + 1];
+  best.base = -1;
+  cur.base = -1;
+  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+    {
+      if (words[i] == 0)
+        {
+          if (cur.base == -1)
+            cur.base = i, cur.len = 1;
+          else
+            cur.len++;
+        }
+      else
+        {
+          if (cur.base != -1)
+            {
+              if (best.base == -1 || cur.len > best.len)
+                best = cur;
+              cur.base = -1;
+            }
+        }
+    }
+  if (cur.base != -1)
+    {
+      if (best.base == -1 || cur.len > best.len)
+        best = cur;
+    }
+  if (best.base != -1 && best.len < 2)
+    best.base = -1;
+
+  /*
+   * Format the result.
+   */
+  tp = tmp;
+  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+    {
+      /* Are we inside the best run of 0x00's? */
+      if (best.base != -1 && i >= best.base && i < (best.base + best.len))
+        {
+          if (i == best.base)
+            *tp++ = ':';
+          continue;
+        }
+      /* Are we following an initial run of 0x00s or any real hex? */
+      if (i != 0)
+        *tp++ = ':';
+      /* Is this address an encapsulated IPv4? */
+      if (i == 6 && best.base == 0 &&
+          (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
+        {
+          if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
+            return (NULL);
+          tp += strlen (tp);
+          break;
+        }
+      {
+        int len = sprintf (tp, "%x", words[i]);
+        if (len < 0)
+          return NULL;
+        tp += len;
+      }
+    }
+  /* Was it a trailing run of 0x00's? */
+  if (best.base != -1 && (best.base + best.len) ==
+      (NS_IN6ADDRSZ / NS_INT16SZ))
+    *tp++ = ':';
+  *tp++ = '\0';
+
+  /*
+   * Check for overflow, copy, and we're done.
+   */
+  if ((socklen_t) (tp - tmp) > size)
+    {
+      errno = ENOSPC;
+      return NULL;
+    }
+
+  return strcpy (dst, tmp);
+}
+
+# endif
+
+#endif
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 3390739..4777c60 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -27,7 +27,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests 
--no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept 
alloca alphasort argp bind byteswap c-ctype close crypto/hmac-md5 crypto/md5 
error extensions func getpass getsubopt gettext gettime havelib inet_pton 
lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings 
memmem-simple minmax netdb netinet_in progname read-file recvfrom scandir 
select sendto setsockopt shutdown snprintf socket sockets socklen stdint 
strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd 
valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix 
vprintf-posix vsnprintf warnings
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests 
--no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept 
alloca alphasort argp bind byteswap c-ctype close connect crypto/hmac-md5 
crypto/md5 error extensions func getpass getsubopt gettext gettime havelib 
inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen 
maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in progname 
read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf 
socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r 
timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf 
vfprintf-posix vprintf-posix vsnprintf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -40,6 +40,7 @@ gl_MODULES([
   byteswap
   c-ctype
   close
+  connect
   crypto/hmac-md5
   crypto/md5
   error
@@ -50,6 +51,7 @@ gl_MODULES([
   gettext
   gettime
   havelib
+  inet_ntop
   inet_pton
   lib-msvc-compat
   lib-symbol-versions
@@ -62,9 +64,11 @@ gl_MODULES([
   netinet_in
   progname
   read-file
+  recv
   recvfrom
   scandir
   select
+  send
   sendto
   setsockopt
   shutdown
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 461cac0..1461989 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -142,6 +142,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module ignore-value:
   # Code from module ignore-value-tests:
   # Code from module include_next:
+  # Code from module inet_ntop:
+  # Code from module inet_ntop-tests:
   # Code from module inet_pton:
   # Code from module inet_pton-tests:
   # Code from module intprops:
@@ -213,12 +215,16 @@ AC_DEFUN([gl_EARLY],
   # Code from module read-file-tests:
   # Code from module readdir:
   # Code from module realloc-posix:
+  # Code from module recv:
+  # Code from module recv-tests:
   # Code from module recvfrom:
   # Code from module recvfrom-tests:
   # Code from module same-inode:
   # Code from module scandir:
   # Code from module select:
   # Code from module select-tests:
+  # Code from module send:
+  # Code from module send-tests:
   # Code from module sendto:
   # Code from module sendto-tests:
   # Code from module setenv:
@@ -393,6 +399,11 @@ if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; 
then
   AC_LIBOBJ([closedir])
 fi
 gl_DIRENT_MODULE_INDICATOR([closedir])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+  AC_LIBOBJ([connect])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([connect])
 gl_MD5
 gl_DIRENT_H
 gl_DIRNAME_LGPL
@@ -512,6 +523,12 @@ m4_if(m4_version_compare([2.61a.100],
         m4_defn([m4_PACKAGE_VERSION])), [1], [],
       [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
         [GNUmakefile=$GNUmakefile])])
+gl_FUNC_INET_NTOP
+if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
+  AC_LIBOBJ([inet_ntop])
+  gl_PREREQ_INET_NTOP
+fi
+gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
 gl_FUNC_INET_PTON
 if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
   AC_LIBOBJ([inet_pton])
@@ -618,6 +635,11 @@ fi
 gl_STDLIB_MODULE_INDICATOR([realloc-posix])
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
 if test "$ac_cv_header_winsock2_h" = yes; then
+  AC_LIBOBJ([recv])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([recv])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
   AC_LIBOBJ([recvfrom])
 fi
 gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom])
@@ -634,6 +656,11 @@ fi
 gl_SYS_SELECT_MODULE_INDICATOR([select])
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
 if test "$ac_cv_header_winsock2_h" = yes; then
+  AC_LIBOBJ([send])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([send])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
   AC_LIBOBJ([sendto])
 fi
 gl_SYS_SOCKET_MODULE_INDICATOR([sendto])
@@ -826,11 +853,6 @@ changequote([, ])dnl
   AC_SUBST([gltests_WITNESS])
   gl_module_indicator_condition=$gltests_WITNESS
   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
-AC_REQUIRE([gl_HEADER_SYS_SOCKET])
-if test "$ac_cv_header_winsock2_h" = yes; then
-  AC_LIBOBJ([connect])
-fi
-gl_SYS_SOCKET_MODULE_INDICATOR([connect])
 gl_FUNC_DUP2
 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
   AC_LIBOBJ([dup2])
@@ -868,6 +890,7 @@ fi
 gl_UNISTD_MODULE_INDICATOR([getpagesize])
 AC_REQUIRE([AC_C_INLINE])
 AC_C_BIGENDIAN
+AC_C_BIGENDIAN
 gl_INTTYPES_H
 gl_INTTYPES_INCOMPLETE
 gl_FUNC_IOCTL
@@ -1092,6 +1115,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/c-ctype.h
   lib/close.c
   lib/closedir.c
+  lib/connect.c
   lib/dirent-private.h
   lib/dirent.in.h
   lib/dirname-lgpl.c
@@ -1131,6 +1155,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/gettimeofday.c
   lib/hmac-md5.c
   lib/hmac.h
+  lib/inet_ntop.c
   lib/inet_pton.c
   lib/intprops.h
   lib/isnan.c
@@ -1177,9 +1202,11 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/read-file.h
   lib/readdir.c
   lib/realloc.c
+  lib/recv.c
   lib/recvfrom.c
   lib/scandir.c
   lib/select.c
+  lib/send.c
   lib/sendto.c
   lib/setsockopt.c
   lib/shutdown.c
@@ -1291,6 +1318,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/gnulib-common.m4
   m4/iconv.m4
   m4/include_next.m4
+  m4/inet_ntop.m4
   m4/inet_pton.m4
   m4/intdiv0.m4
   m4/intl.m4
@@ -1482,6 +1510,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-gettimeofday.c
   tests/test-hmac-md5.c
   tests/test-ignore-value.c
+  tests/test-inet_ntop.c
   tests/test-inet_pton.c
   tests/test-intprops.c
   tests/test-inttypes.c
@@ -1516,6 +1545,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-printf-posix.output
   tests/test-rawmemchr.c
   tests/test-read-file.c
+  tests/test-recv.c
   tests/test-recvfrom.c
   tests/test-select-fd.c
   tests/test-select-in.sh
@@ -1523,6 +1553,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-select-stdin.c
   tests/test-select.c
   tests/test-select.h
+  tests/test-send.c
   tests/test-sendto.c
   tests/test-setenv.c
   tests/test-setsockopt.c
@@ -1579,7 +1610,6 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-wchar.c
   tests/zerosize-ptr.h
   tests=lib/binary-io.h
-  tests=lib/connect.c
   tests=lib/dup2.c
   tests=lib/fcntl.in.h
   tests=lib/fdopen.c
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
new file mode 100644
index 0000000..4936fa3
--- /dev/null
+++ b/gl/m4/inet_ntop.m4
@@ -0,0 +1,68 @@
+# inet_ntop.m4 serial 19
+dnl Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_INET_NTOP],
+[
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+  dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  dnl Most platforms that provide inet_ntop define it in libc.
+  dnl Solaris 8..10 provide inet_ntop in libnsl instead.
+  dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
+  dnl Native Windows provides it in -lws2_32 instead, with a declaration in
+  dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
+  dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
+  HAVE_INET_NTOP=1
+  INET_NTOP_LIB=
+  gl_PREREQ_SYS_H_WINSOCK2
+  if test $HAVE_WINSOCK2_H = 1; then
+    AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
+    if test $ac_cv_have_decl_inet_ntop = yes; then
+      dnl It needs to be overridden, because the stdcall calling convention
+      dnl is not compliant with POSIX.
+      REPLACE_INET_NTOP=1
+      INET_NTOP_LIB="-lws2_32"
+    else
+      HAVE_DECL_INET_NTOP=0
+      HAVE_INET_NTOP=0
+    fi
+  else
+    gl_save_LIBS=$LIBS
+    AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
+      [AC_CHECK_FUNCS([inet_ntop])
+       if test $ac_cv_func_inet_ntop = no; then
+         HAVE_INET_NTOP=0
+       fi
+      ])
+    LIBS=$gl_save_LIBS
+
+    if test "$ac_cv_search_inet_ntop" != "no" \
+       && test "$ac_cv_search_inet_ntop" != "none required"; then
+      INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+    fi
+
+    AC_CHECK_HEADERS_ONCE([netdb.h])
+    AC_CHECK_DECLS([inet_ntop],,,
+      [[#include <arpa/inet.h>
+        #if HAVE_NETDB_H
+        # include <netdb.h>
+        #endif
+      ]])
+    if test $ac_cv_have_decl_inet_ntop = no; then
+      HAVE_DECL_INET_NTOP=0
+    fi
+  fi
+  AC_SUBST([INET_NTOP_LIB])
+])
+
+# Prerequisites of lib/inet_ntop.c.
+AC_DEFUN([gl_PREREQ_INET_NTOP], [
+  AC_REQUIRE([gl_SOCKET_FAMILIES])
+])
diff --git a/gl/listen.c b/gl/recv.c
similarity index 87%
copy from gl/listen.c
copy to gl/recv.c
index b7d070e..4755f63 100644
--- a/gl/listen.c
+++ b/gl/recv.c
@@ -1,4 +1,4 @@
-/* listen.c --- wrappers for Windows listen function
+/* recv.c --- wrappers for Windows recv function
 
    Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
@@ -26,10 +26,10 @@
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
 #include "w32sock.h"
 
-#undef listen
+#undef recv
 
-int
-rpl_listen (int fd, int backlog)
+ssize_t
+rpl_recv (int fd, void *buf, size_t len, int flags)
 {
   SOCKET sock = FD_TO_SOCKET (fd);
 
@@ -40,7 +40,7 @@ rpl_listen (int fd, int backlog)
     }
   else
     {
-      int r = listen (sock, backlog);
+      int r = recv (sock, buf, len, flags);
       if (r < 0)
         set_winsock_errno ();
 
diff --git a/gl/listen.c b/gl/send.c
similarity index 86%
copy from gl/listen.c
copy to gl/send.c
index b7d070e..cd21482 100644
--- a/gl/listen.c
+++ b/gl/send.c
@@ -1,4 +1,4 @@
-/* listen.c --- wrappers for Windows listen function
+/* send.c --- wrappers for Windows send function
 
    Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
@@ -26,10 +26,10 @@
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
 #include "w32sock.h"
 
-#undef listen
+#undef send
 
-int
-rpl_listen (int fd, int backlog)
+ssize_t
+rpl_send (int fd, const void *buf, size_t len, int flags)
 {
   SOCKET sock = FD_TO_SOCKET (fd);
 
@@ -40,7 +40,7 @@ rpl_listen (int fd, int backlog)
     }
   else
     {
-      int r = listen (sock, backlog);
+      int r = send (sock, buf, len, flags);
       if (r < 0)
         set_winsock_errno ();
 
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 205b736..4759912 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -142,15 +142,6 @@ EXTRA_DIST += test-close.c signature.h macros.h
 
 ## end   gnulib module close-tests
 
-## begin gnulib module connect
-
-
-EXTRA_DIST += connect.c w32sock.h
-
-EXTRA_libtests_a_SOURCES += connect.c
-
-## end   gnulib module connect
-
 ## begin gnulib module connect-tests
 
 TESTS += test-connect
@@ -500,6 +491,15 @@ EXTRA_DIST += test-ignore-value.c
 
 ## end   gnulib module ignore-value-tests
 
+## begin gnulib module inet_ntop-tests
+
+TESTS += test-inet_ntop
+check_PROGRAMS += test-inet_ntop
+test_inet_ntop_LDADD = $(LDADD) @INET_NTOP_LIB@
+EXTRA_DIST += test-inet_ntop.c signature.h macros.h
+
+## end   gnulib module inet_ntop-tests
+
 ## begin gnulib module inet_pton-tests
 
 TESTS += test-inet_pton
@@ -816,6 +816,15 @@ EXTRA_DIST += test-read-file.c
 
 ## end   gnulib module read-file-tests
 
+## begin gnulib module recv-tests
+
+TESTS += test-recv
+check_PROGRAMS += test-recv
+test_recv_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-recv.c signature.h macros.h
+
+## end   gnulib module recv-tests
+
 ## begin gnulib module recvfrom-tests
 
 TESTS += test-recvfrom
@@ -844,6 +853,15 @@ EXTRA_DIST += macros.h signature.h test-select.c 
test-select.h test-select-fd.c
 
 ## end   gnulib module select-tests
 
+## begin gnulib module send-tests
+
+TESTS += test-send
+check_PROGRAMS += test-send
+test_send_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-send.c signature.h macros.h
+
+## end   gnulib module send-tests
+
 ## begin gnulib module sendto-tests
 
 TESTS += test-sendto
diff --git a/gl/tests/test-inet_pton.c b/gl/tests/test-inet_ntop.c
similarity index 65%
copy from gl/tests/test-inet_pton.c
copy to gl/tests/test-inet_ntop.c
index 49c140c..ebb7c1c 100644
--- a/gl/tests/test-inet_pton.c
+++ b/gl/tests/test-inet_ntop.c
@@ -1,4 +1,4 @@
-/* Test of inet_pton function.
+/* Test of inet_ntop function.
    Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -21,10 +21,12 @@
 #include <arpa/inet.h>
 
 #include "signature.h"
-SIGNATURE_CHECK (inet_pton, int, (int, const char *, void *));
+SIGNATURE_CHECK (inet_ntop, char const *, (int, void const *, char *,
+                                           socklen_t));
 
 #include <netinet/in.h>
 #include <sys/socket.h>
+#include <string.h>
 
 #include "macros.h"
 
@@ -33,24 +35,20 @@ main (void)
 {
 #if defined AF_INET /* HAVE_IPV4 */
   {
+    struct in_addr internal;
+    char printable[16];
+    const char *result;
+
     /* This machine was for a long time known as
        ma2s2.mathematik.uni-karlsruhe.de.  */
-    const char printable[] = "129.13.115.2";
-    struct in_addr internal;
-    int ret;
-
-    ret = inet_pton (AF_INET, printable, &internal);
-    ASSERT (ret == 1);
-    /* Verify that internal is filled in network byte order.  */
-    ASSERT (((unsigned char *) &internal)[0] == 0x81);
-    ASSERT (((unsigned char *) &internal)[1] == 0x0D);
-    ASSERT (((unsigned char *) &internal)[2] == 0x73);
-    ASSERT (((unsigned char *) &internal)[3] == 0x02);
 # ifdef WORDS_BIGENDIAN
-    ASSERT (internal.s_addr == 0x810D7302);
+    internal.s_addr = 0x810D7302;
 # else
-    ASSERT (internal.s_addr == 0x02730D81);
+    internal.s_addr = 0x02730D81;
 # endif
+    result = inet_ntop (AF_INET, &internal, printable, sizeof (printable));
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "129.13.115.2") == 0);
   }
 #endif
 
diff --git a/gl/tests/test-shutdown.c b/gl/tests/test-recv.c
similarity index 83%
copy from gl/tests/test-shutdown.c
copy to gl/tests/test-recv.c
index d154f8e..ae811b6 100644
--- a/gl/tests/test-shutdown.c
+++ b/gl/tests/test-recv.c
@@ -1,4 +1,4 @@
-/* Test the shutdown() function.
+/* Test the recv() function.
    Copyright (C) 2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@
 #include <sys/socket.h>
 
 #include "signature.h"
-SIGNATURE_CHECK (shutdown, int, (int, int));
+SIGNATURE_CHECK (recv, ssize_t, (int, void *, size_t, int));
 
 #include <errno.h>
 
@@ -33,13 +33,15 @@ main (void)
 
   /* Test behaviour for invalid file descriptors.  */
   {
+    char byte;
     errno = 0;
-    ASSERT (shutdown (-1, SHUT_RD) == -1);
+    ASSERT (recv (-1, &byte, 1, 0) == -1);
     ASSERT (errno == EBADF);
   }
   {
+    char byte;
     errno = 0;
-    ASSERT (shutdown (99, SHUT_RD) == -1);
+    ASSERT (recv (99, &byte, 1, 0) == -1);
     ASSERT (errno == EBADF);
   }
 
diff --git a/gl/tests/test-listen.c b/gl/tests/test-send.c
similarity index 82%
copy from gl/tests/test-listen.c
copy to gl/tests/test-send.c
index becc453..9fb24d4 100644
--- a/gl/tests/test-listen.c
+++ b/gl/tests/test-send.c
@@ -1,4 +1,4 @@
-/* Test listen() function.
+/* Test the send() function.
    Copyright (C) 2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@
 #include <sys/socket.h>
 
 #include "signature.h"
-SIGNATURE_CHECK (listen, int, (int, int));
+SIGNATURE_CHECK (send, ssize_t, (int, const void *, size_t, int));
 
 #include <errno.h>
 
@@ -33,13 +33,15 @@ main (void)
 
   /* Test behaviour for invalid file descriptors.  */
   {
+    char byte = 'x';
     errno = 0;
-    ASSERT (listen (-1, 1) == -1);
+    ASSERT (send (-1, &byte, 1, 0) == -1);
     ASSERT (errno == EBADF);
   }
   {
+    char byte = 'x';
     errno = 0;
-    ASSERT (listen (99 ,1) == -1);
+    ASSERT (send (99, &byte, 1, 0) == -1);
     ASSERT (errno == EBADF);
   }
 
diff --git a/src/benchmark.c b/src/benchmark.c
index 229f24b..42f821c 100644
--- a/src/benchmark.c
+++ b/src/benchmark.c
@@ -83,7 +83,9 @@ value2human (unsigned long bytes, double time, double *data, 
double *speed,
 void start_benchmark(struct benchmark_st * st)
 {
   memset(st, 0, sizeof(*st));
+#ifndef _WIN32
   st->old_handler = signal (SIGALRM, alarm_handler);
+#endif
   gettime (&st->start);
   benchmark_must_finish = 0;
 
@@ -100,13 +102,12 @@ void start_benchmark(struct benchmark_st * st)
       fprintf (stderr, "error: CreateThread %u\n", GetLastError ());
       exit(1);
     }
-  alarm_timeout.QuadPart = (5) * 10000000;
-  if (SetWaitableTimer (st->wtimer, &alarm_timeout, 0, NULL, NULL, FALSE) == 0)
+  st->alarm_timeout.QuadPart = (5) * 10000000;
+  if (SetWaitableTimer (st->wtimer, &st->alarm_timeout, 0, NULL, NULL, FALSE) 
== 0)
     {
       fprintf (stderr, "error: SetWaitableTimer %u\n", GetLastError ());
       exit(1);
     }
-  }
 #else
   alarm (5);
 #endif
diff --git a/src/benchmark.h b/src/benchmark.h
index 0bf172e..4f916a8 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -1,6 +1,9 @@
 #include <sys/time.h>
 #include <time.h>
 #include <signal.h>
+#if defined(_WIN32)
+# include <windows.h>
+#endif
 #include "timespec.h"           /* gnulib gettime */
 
 typedef void (*sighandler_t)(int);


hooks/post-receive
-- 
GNU gnutls



reply via email to

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