summaryrefslogtreecommitdiff
path: root/tests/test-nonblocking.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-04-18 02:34:47 +0200
committerBruno Haible <bruno@clisp.org>2011-04-19 12:07:33 +0200
commit6110d07dee40692d43f2ef8884230e0d53c56548 (patch)
treec9ad90ba1bc0bacbdf4a8a7c5e7181b04628f165 /tests/test-nonblocking.c
parent12856373f8fd28a9d4453d6df97b2fdd17ced398 (diff)
downloadgnulib-6110d07dee40692d43f2ef8884230e0d53c56548.tar.gz
ioctl: Remove link dependency on native Windows.
* lib/fd-hook.h: Renamed from lib/close-hook.h. (gl_close_fn, gl_ioctl_fn): New types. (struct fd_hook): Renamed from struct close_hook. Change type of private_close_fn field. Add private_ioctl_fn field. (close_hook_fn): Add parameter for primary close method. (execute_close_hooks, execute_all_close_hooks): Likewise. (ioctl_hook_fn): New type. (execute_ioctl_hooks, execute_all_ioctl_hooks): New declarations. (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook argument. (unregister_fd_hook): Renamed from unregister_close_hook. * lib/fd-hook.c: Renamed from lib/close-hook.c. Don't include <unistd.h>. (close): Remove undef. (anchor): Update. (execute_close_hooks): Add argument for primary close method. (execute_all_close_hooks): Likewise. (execute_ioctl_hooks, execute_all_ioctl_hooks): New functions. (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook argument. Allow each argument to be NULL. (unregister_fd_hook): Renamed from unregister_close_hook. * lib/close.c (rpl_close): Pass 'close' function pointer to execute_all_close_hooks. * lib/ioctl.c: Include <errno.h>, fd-hook.h. (primary_ioctl): New function. (ioctl): Don't call ioctlsocket here. Instead, call execute_all_ioctl_hooks. * lib/sockets.c (close_fd_maybe_socket): Add argument for primary close method. (ioctl_fd_maybe_socket): New function, with code from lib/ioctl.c. (fd_sockets_hook): Renamed from close_sockets_hook. (gl_sockets_startup, gl_sockets_cleanup): Update. * modules/fd-hook: Renamed from modules/close-hook. Update. * modules/close (Depends-on): Add fd-hook, remove close-hook. * modules/sockets (Depends-on): Likewise. * modules/ioctl (Depends-on): Add fd-hook. * tests/test-nonblocking.c (main): Use GNULIB_TEST_SOCKET, not GNULIB_SOCKET.
Diffstat (limited to 'tests/test-nonblocking.c')
-rw-r--r--tests/test-nonblocking.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-nonblocking.c b/tests/test-nonblocking.c
index bfeef7bf71..f3f1f1355b 100644
--- a/tests/test-nonblocking.c
+++ b/tests/test-nonblocking.c
@@ -79,7 +79,7 @@ main (void)
ASSERT (close (fd_pipe[1]) == 0);
#endif /* GNULIB_TEST_PIPE2 */
-#if GNULIB_SOCKET
+#if GNULIB_TEST_SOCKET
{
/* Test sockets. */
bool sock_works = true;
@@ -104,7 +104,7 @@ main (void)
ASSERT (close (fd_sock) == 0);
# endif /* SOCK_NONBLOCK */
}
-#endif /* GNULIB_SOCKET */
+#endif /* GNULIB_TEST_SOCKET */
/* Test error handling. */
{