From dbd243d0795137dc4877821dfb3d292fe80bcc5f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 21 Oct 2008 17:15:43 +0200 Subject: [PATCH] Cleanup and simplify winsock split changes. Simplification. * lib/sys_socket.in.h (_gl_close_fd_maybe_socket): Remove declaration. * lib/close.c (_gl_close_fd_maybe_socket): Make static. Simplification. * lib/ioctl.c (ioctl): Don't undefine. * lib/socket.c (socket): Don't undefine. Remove unused module indicator macros. * m4/sys_socket_h.m4 (gl_SYS_SOCKET_MODULE_INDICATOR): Don't define GNULIB_$1 as a C macro. * doc/posix-functions/close.texi: Undo last change. * doc/posix-functions/ioctl.texi: Merge the two paragraphs about Windows platforms. --- ChangeLog | 18 ++++++++++++++++++ doc/posix-functions/close.texi | 4 ---- doc/posix-functions/ioctl.texi | 8 +++----- lib/close.c | 2 +- lib/ioctl.c | 2 -- lib/socket.c | 2 -- lib/sys_socket.in.h | 3 +-- m4/sys_socket_h.m4 | 1 - 8 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b7bbfaf5..132cb8a4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2008-10-21 Bruno Haible + Simplification. + * lib/sys_socket.in.h (_gl_close_fd_maybe_socket): Remove declaration. + * lib/close.c (_gl_close_fd_maybe_socket): Make static. + + Simplification. + * lib/ioctl.c (ioctl): Don't undefine. + * lib/socket.c (socket): Don't undefine. + + Remove unused module indicator macros. + * m4/sys_socket_h.m4 (gl_SYS_SOCKET_MODULE_INDICATOR): Don't define + GNULIB_$1 as a C macro. + + * doc/posix-functions/close.texi: Undo last change. + * doc/posix-functions/ioctl.texi: Merge the two paragraphs about + Windows platforms. + +2008-10-21 Bruno Haible + Add gethostname() declaration to . * lib/unistd.in.h (gethostname): New declaration. * lib/gethostname.c: Include . diff --git a/doc/posix-functions/close.texi b/doc/posix-functions/close.texi index 7065efaca..252caea61 100644 --- a/doc/posix-functions/close.texi +++ b/doc/posix-functions/close.texi @@ -12,10 +12,6 @@ Portability problems fixed by Gnulib: On Windows platforms (excluding Cygwin), @code{socket} and @code{accept} do not return file descriptors that can be closed by @code{close}. Instead, @code{closesocket} must be used. -@item -On Windows platforms (excluding Cygwin), error codes for @code{close} -are not placed in @code{errno}, and @code{WSAGetLastError} must be -used instead. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/ioctl.texi b/doc/posix-functions/ioctl.texi index 85ba764a4..d1574bb59 100644 --- a/doc/posix-functions/ioctl.texi +++ b/doc/posix-functions/ioctl.texi @@ -9,11 +9,9 @@ Gnulib module: ioctl Portability problems fixed by Gnulib: @itemize @item -On Windows platforms (excluding Cygwin), error codes for @code{ioctl} -are not placed in @code{errno}, and @code{WSAGetLastError} must be -used instead. -@item -@code{ioctl} is called @code{ioctlsocket} under mingw +On Windows platforms (excluding Cygwin), @code{ioctl} is called +@code{ioctlsocket}, and error codes for this function are not placed in +@code{errno}, and @code{WSAGetLastError} must be used instead. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/close.c b/lib/close.c index 79313c008..74a7adfbb 100644 --- a/lib/close.c +++ b/lib/close.c @@ -29,7 +29,7 @@ /* Get set_winsock_errno, FD_TO_SOCKET etc. */ #include "w32sock.h" -int +static int _gl_close_fd_maybe_socket (int fd) { SOCKET sock = FD_TO_SOCKET (fd); diff --git a/lib/ioctl.c b/lib/ioctl.c index 98a94b672..a23d363bc 100644 --- a/lib/ioctl.c +++ b/lib/ioctl.c @@ -28,8 +28,6 @@ /* Get set_winsock_errno, FD_TO_SOCKET etc. */ #include "w32sock.h" -#undef ioctl - int rpl_ioctl (int fd, int req, ...) { diff --git a/lib/socket.c b/lib/socket.c index f14906a0d..1fa692874 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -26,8 +26,6 @@ /* Get set_winsock_errno, FD_TO_SOCKET etc. */ #include "w32sock.h" -#undef socket - int rpl_socket (int domain, int type, int protocol) { diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index b70320008..fcb4a2269 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -389,9 +389,8 @@ extern int rpl_shutdown (int, int); # endif # if @GNULIB_CLOSE@ && @HAVE_WINSOCK2_H@ -/* gnulib internal function. */ +/* Need a gnulib internal function. */ # define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1 -extern int _gl_close_fd_maybe_socket (int fd); # endif # ifdef __cplusplus diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 index fc43d5c5c..b7b18e530 100644 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -96,7 +96,6 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 - gl_MODULE_INDICATOR([$1]) ]) AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], -- 2.11.0