diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-11-11 17:18:46 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-11-11 17:18:46 +0100 |
commit | a042388ec5a063ca7f6cfe9f2d2b0c6e6c21a90f (patch) | |
tree | 4a418deb292d9014568ae0c62273daa59a740755 /gl | |
parent | 4fd3f55c593a5108956d86dd9627756463890046 (diff) | |
download | gnutls-a042388ec5a063ca7f6cfe9f2d2b0c6e6c21a90f.tar.gz |
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/Makefile.am | 7 | ||||
-rw-r--r-- | gl/fseeko.c | 2 | ||||
-rw-r--r-- | gl/m4/getaddrinfo.m4 | 22 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 3 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 2 | ||||
-rw-r--r-- | gl/m4/netdb_h.m4 | 8 | ||||
-rw-r--r-- | gl/m4/printf.m4 | 9 | ||||
-rw-r--r-- | gl/netdb.in.h | 12 | ||||
-rw-r--r-- | gl/tests/test-select-fd.c | 50 | ||||
-rwxr-xr-x | gl/tests/test-select-in.sh | 12 | ||||
-rwxr-xr-x | gl/tests/test-select-out.sh | 12 |
11 files changed, 95 insertions, 44 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index 56485911d8..e2c075879d 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -9,7 +9,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 --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf +# 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 --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings AUTOMAKE_OPTIONS = 1.5 gnits @@ -362,6 +362,11 @@ netdb.h: netdb.in.h -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \ -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \ -e 's|@''GNULIB_GETADDRINFO''@|$(GNULIB_GETADDRINFO)|g' \ + -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \ + -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \ + -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ < $(srcdir)/netdb.in.h; \ } > $@-t mv $@-t $@ diff --git a/gl/fseeko.c b/gl/fseeko.c index 48ff48e141..e0c5ae793d 100644 --- a/gl/fseeko.c +++ b/gl/fseeko.c @@ -41,7 +41,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #endif /* These tests are based on fpurge.c. */ -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_read_end == fp->_IO_read_ptr && fp->_IO_write_ptr == fp->_IO_write_base && fp->_IO_save_base == NULL) diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4 index c184c6f294..c3fa1c6a67 100644 --- a/gl/m4/getaddrinfo.m4 +++ b/gl/m4/getaddrinfo.m4 @@ -1,4 +1,4 @@ -# getaddrinfo.m4 serial 16 +# getaddrinfo.m4 serial 17 dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -71,8 +71,9 @@ AC_DEFUN([gl_GETADDRINFO], gl_PREREQ_GETADDRINFO ]) -# Prerequisites of lib/getaddrinfo.c. +# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c. AC_DEFUN([gl_PREREQ_GETADDRINFO], [ + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_SEARCH_LIBS(gethostbyname, [inet nsl]) AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) @@ -104,6 +105,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) AC_CHECK_HEADERS_ONCE(netinet/in.h) + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and @@ -119,6 +121,19 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #include <ws2tcpip.h> #endif ]) + if test $ac_cv_have_decl_getaddrinfo = no; then + HAVE_DECL_GETADDRINFO=0 + fi + if test $ac_cv_have_decl_freeaddrinfo = no; then + HAVE_DECL_FREEADDRINFO=0 + fi + if test $ac_cv_have_decl_gai_strerror = no; then + HAVE_DECL_GAI_STRERROR=0 + fi + if test $ac_cv_have_decl_getnameinfo = no; then + HAVE_DECL_GETNAMEINFO=0 + fi + AC_CHECK_TYPES([struct addrinfo],,,[ #include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H @@ -131,4 +146,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #include <ws2tcpip.h> #endif ]) + if test $ac_cv_type_struct_addrinfo = no; then + HAVE_STRUCT_ADDRINFO=0 + fi ]) diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 6fc3e49663..6e42289883 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -15,7 +15,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 --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf +# 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 --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) @@ -53,6 +53,7 @@ gl_MODULES([ socket sys_stat version-etc-fsf + warnings ]) gl_AVOID([]) gl_SOURCE_BASE([gl]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 112fa2ff6d..ddf311cbd0 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -177,6 +177,7 @@ AC_SUBST([LTALLOCA]) AC_PROG_MKDIR_P gl_UNISTD_H gl_FUNC_VASNPRINTF + gl_WARN_INIT gl_WCHAR_H gl_XSIZE m4_ifval(gl_LIBSOURCES_LIST, [ @@ -464,6 +465,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/sys_time_h.m4 m4/unistd_h.m4 m4/vasnprintf.m4 + m4/warnings.m4 m4/wchar.m4 m4/wchar_t.m4 m4/wint_t.m4 diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4 index bbe166fab4..6ae1248177 100644 --- a/gl/m4/netdb_h.m4 +++ b/gl/m4/netdb_h.m4 @@ -1,4 +1,4 @@ -# netdb_h.m4 serial 3 +# netdb_h.m4 serial 4 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -30,4 +30,10 @@ AC_DEFUN([gl_NETDB_MODULE_INDICATOR], AC_DEFUN([gl_NETDB_H_DEFAULTS], [ GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO]) + HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO]) + HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR]) + HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO]) + HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO]) ]) diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4 index d544edd72d..df26c13ecc 100644 --- a/gl/m4/printf.m4 +++ b/gl/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 23 +# printf.m4 serial 24 dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -815,6 +815,7 @@ AC_DEFUN([gl_PRINTF_ENOMEM], AC_CACHE_CHECK([whether printf survives out-of-memory conditions], [gl_cv_func_printf_enomem], [ + gl_cv_func_printf_enomem="guessing no" if test "$cross_compiling" = no; then AC_LANG_CONFTEST([AC_LANG_SOURCE([ ]GL_NOCRASH[ @@ -880,7 +881,8 @@ changequote([,])dnl gl_cv_func_printf_enomem="guessing no" fi rm -fr conftest* - else + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. @@ -901,6 +903,8 @@ changequote(,)dnl osf*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_enomem="guessing no";; esac @@ -1305,5 +1309,6 @@ dnl OSF/1 5.1 # . # # # # . . . . # . . . . dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # # dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ? dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . . +dnl Haiku . . . # # # . . . . . . ? . . . . . . dnl BeOS # # . # # # . # . ? . # ? . . . . . . dnl mingw # # # # # # . # # . # # ? . # # # . . diff --git a/gl/netdb.in.h b/gl/netdb.in.h index 66f4fc6921..523136224a 100644 --- a/gl/netdb.in.h +++ b/gl/netdb.in.h @@ -36,7 +36,7 @@ #ifndef _GL_NETDB_H #define _GL_NETDB_H -#if @HAVE_NETDB_H@ && HAVE_STRUCT_ADDRINFO +#if @HAVE_NETDB_H@ && @HAVE_STRUCT_ADDRINFO@ /* Declarations for a platform that has <netdb.h>. */ @@ -50,7 +50,7 @@ #if @GNULIB_GETADDRINFO@ -# ifndef HAVE_STRUCT_ADDRINFO +# if !@HAVE_STRUCT_ADDRINFO@ /* Structure to contain information about address of a service provider. */ struct addrinfo @@ -139,7 +139,7 @@ struct addrinfo # endif # endif -# if !HAVE_DECL_GETADDRINFO +# if !@HAVE_DECL_GETADDRINFO@ /* Translate name of a service location and/or a service name to set of socket addresses. For more details, see the POSIX:2001 specification @@ -150,21 +150,21 @@ extern int getaddrinfo (const char *restrict nodename, struct addrinfo **restrict res); # endif -# if !HAVE_DECL_FREEADDRINFO +# if !@HAVE_DECL_FREEADDRINFO@ /* Free `addrinfo' structure AI including associated storage. For more details, see the POSIX:2001 specification <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */ extern void freeaddrinfo (struct addrinfo *ai); # endif -# if !HAVE_DECL_GAI_STRERROR +# if !@HAVE_DECL_GAI_STRERROR@ /* Convert error return from getaddrinfo() to a string. For more details, see the POSIX:2001 specification <http://www.opengroup.org/susv3xsh/gai_strerror.html>. */ extern const char *gai_strerror (int ecode); # endif -# if !HAVE_DECL_GETNAMEINFO +# if !@HAVE_DECL_GETNAMEINFO@ /* Convert socket address to printable node and service names. For more details, see the POSIX:2001 specification <http://www.opengroup.org/susv3xsh/getnameinfo.html>. */ diff --git a/gl/tests/test-select-fd.c b/gl/tests/test-select-fd.c index d362170a87..ddd2013de0 100644 --- a/gl/tests/test-select-fd.c +++ b/gl/tests/test-select-fd.c @@ -25,7 +25,7 @@ int main (int argc, char *argv[]) { - if (argc == 3) + if (argc == 4) { char mode = argv[1][0]; @@ -35,32 +35,38 @@ main (int argc, char *argv[]) if (fd >= 0) { - fd_set fds; - struct timeval timeout; - int ret; + const char *result_file_name = argv[3]; + FILE *result_file = fopen (result_file_name, "wb"); - FD_ZERO (&fds); - FD_SET (fd, &fds); - timeout.tv_sec = 0; - timeout.tv_usec = 10000; - ret = (mode == 'r' - ? select (fd + 1, &fds, NULL, NULL, &timeout) - : select (fd + 1, NULL, &fds, NULL, &timeout)); - if (ret < 0) + if (result_file != NULL) { - perror ("select failed"); - exit (1); - } - if ((ret == 0) != ! FD_ISSET (fd, &fds)) - { - fprintf (stderr, "incorrect return value\n"); - exit (1); + fd_set fds; + struct timeval timeout; + int ret; + + FD_ZERO (&fds); + FD_SET (fd, &fds); + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + ret = (mode == 'r' + ? select (fd + 1, &fds, NULL, NULL, &timeout) + : select (fd + 1, NULL, &fds, NULL, &timeout)); + if (ret < 0) + { + perror ("select failed"); + exit (1); + } + if ((ret == 0) != ! FD_ISSET (fd, &fds)) + { + fprintf (stderr, "incorrect return value\n"); + exit (1); + } + fprintf (result_file, "%d\n", ret); + exit (0); } - fprintf (stderr, "%d\n", ret); - exit (0); } } } - fprintf (stderr, "Usage: test-select-fd mode fd\n"); + fprintf (stderr, "Usage: test-select-fd mode fd result-file-name\n"); exit (1); } diff --git a/gl/tests/test-select-in.sh b/gl/tests/test-select-in.sh index b93fee9a04..8fd9d9c45c 100755 --- a/gl/tests/test-select-in.sh +++ b/gl/tests/test-select-in.sh @@ -8,20 +8,24 @@ tmpfiles="$tmpfiles t-select-in.tmp" # Regular files. -./test-select-fd${EXEEXT} r 0 < ./test-select-fd${EXEEXT} 2> t-select-in.tmp +rm -f t-select-in.tmp +./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT} test `cat t-select-in.tmp` = "1" || exit 1 # Pipes. -{ sleep 1; echo abc; } | ./test-select-fd${EXEEXT} r 0 2> t-select-in.tmp +rm -f t-select-in.tmp +{ sleep 1; echo abc; } | ./test-select-fd${EXEEXT} r 0 t-select-in.tmp test `cat t-select-in.tmp` = "0" || exit 1 -echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0; } 2> t-select-in.tmp +rm -f t-select-in.tmp +echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; } test `cat t-select-in.tmp` = "1" || exit 1 # Special files. -./test-select-fd${EXEEXT} r 0 < /dev/null 2> t-select-in.tmp +rm -f t-select-in.tmp +./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null test `cat t-select-in.tmp` = "1" || exit 1 rm -fr $tmpfiles diff --git a/gl/tests/test-select-out.sh b/gl/tests/test-select-out.sh index f83beeb1f5..556aae7b45 100755 --- a/gl/tests/test-select-out.sh +++ b/gl/tests/test-select-out.sh @@ -8,20 +8,24 @@ tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp" # Regular files. -./test-select-fd${EXEEXT} w 1 > t-select-out.out 2> t-select-out.tmp +rm -f t-select-out.tmp +./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out test `cat t-select-out.tmp` = "1" || exit 1 # Pipes. -( { echo abc; ./test-select-fd${EXEEXT} w 1; } | { sleep 1; cat; } ) > /dev/null 2> t-select-out.tmp +rm -f t-select-out.tmp +( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null test `cat t-select-out.tmp` = "0" || exit 1 -( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1; } | cat) > /dev/null 2> t-select-out.tmp +rm -f t-select-out.tmp +( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null test `cat t-select-out.tmp` = "1" || exit 1 # Special files. -./test-select-fd${EXEEXT} w 1 > /dev/null 2> t-select-out.tmp +rm -f t-select-out.tmp +./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null test `cat t-select-out.tmp` = "1" || exit 1 rm -fr $tmpfiles |