diff options
author | Max Kellermann <max@duempel.org> | 2008-12-30 19:18:59 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-12-30 19:18:59 +0100 |
commit | 1f0804bdca0f273d667311f645fc48965a37ada1 (patch) | |
tree | e2df2888454baed1dd5a6b642a6455f75dc70eda /src/listen.c | |
parent | 6890183c5021555d29393452cedc13a5b41f3422 (diff) | |
download | mpd-1f0804bdca0f273d667311f645fc48965a37ada1.tar.gz mpd-1f0804bdca0f273d667311f645fc48965a37ada1.tar.xz mpd-1f0804bdca0f273d667311f645fc48965a37ada1.zip |
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.
Diffstat (limited to 'src/listen.c')
-rw-r--r-- | src/listen.c | 8 |
1 files changed, 1 insertions, 7 deletions
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"); } } |