From 1f0804bdca0f273d667311f645fc48965a37ada1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 30 Dec 2008 19:18:59 +0100 Subject: listen: don't make the server socket non-blocking There is no point in making the server socket non-blocking. We call accept() only after select() has notified us about a new connection. --- src/listen.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/listen.c b/src/listen.c index 240539197..e1cb325cf 100644 --- a/src/listen.c +++ b/src/listen.c @@ -67,11 +67,6 @@ static int establishListen(int pf, const struct sockaddr *addrp, if ((sock = socket(pf, SOCK_STREAM, 0)) < 0) g_error("socket < 0"); - if (set_nonblocking(sock) < 0) { - g_error("problems setting nonblocking on listen socket: %s", - strerror(errno)); - } - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&allowReuse, sizeof(allowReuse)) < 0) { g_error("problems setsockopt'ing: %s", strerror(errno)); @@ -283,8 +278,7 @@ void getConnections(fd_set * fds) if ((fd = accept(listenSockets[i], &sockAddr, &socklen)) >= 0) { client_new(fd, &sockAddr, get_remote_uid(fd)); - } else if (fd < 0 - && (errno != EAGAIN && errno != EINTR)) { + } else if (fd < 0 && errno != EINTR) { g_warning("Problems accept()'ing"); } } -- cgit v1.2.3