From f66edccffdc4a9276ae9dced69fa6fb74ee1f97e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Nov 2009 22:11:35 +0100 Subject: fd_util: added O_NONBLOCK functions Changed the wrappers for pipe(), socket(), accept(). On WIN32, this does not work for pipe(). --- src/listen.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/listen.c') diff --git a/src/listen.c b/src/listen.c index 2490780ad..668a8077c 100644 --- a/src/listen.c +++ b/src/listen.c @@ -21,7 +21,6 @@ #include "socket_util.h" #include "client.h" #include "conf.h" -#include "utils.h" #include "fd_util.h" #include "config.h" @@ -429,10 +428,9 @@ listen_in_event(G_GNUC_UNUSED GIOChannel *source, struct sockaddr_storage sa; size_t sa_length = sizeof(sa); - fd = accept_cloexec(listen_fd, (struct sockaddr*)&sa, &sa_length); + fd = accept_cloexec_nonblock(listen_fd, (struct sockaddr*)&sa, + &sa_length); if (fd >= 0) { - set_nonblocking(fd); - client_new(fd, (struct sockaddr*)&sa, sa_length, get_remote_uid(fd)); } else if (fd < 0 && errno != EINTR) { -- cgit v1.2.3