summaryrefslogtreecommitdiff
path: root/src/redis.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redis.c')
-rw-r--r--src/redis.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/redis.c b/src/redis.c
index bd66fcb9a..21ac59968 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -1542,10 +1542,16 @@ int listenToPort(int port, int *fds, int *count) {
* server.bindaddr_count == 0. */
fds[*count] = anetTcp6Server(server.neterr,port,NULL,
server.tcp_backlog);
- if (fds[*count] != ANET_ERR) (*count)++;
+ if (fds[*count] != ANET_ERR) {
+ anetNonBlock(NULL,fds[*count]);
+ (*count)++;
+ }
fds[*count] = anetTcpServer(server.neterr,port,NULL,
server.tcp_backlog);
- if (fds[*count] != ANET_ERR) (*count)++;
+ if (fds[*count] != ANET_ERR) {
+ anetNonBlock(NULL,fds[*count]);
+ (*count)++;
+ }
/* Exit the loop if we were able to bind * on IPv4 or IPv6,
* otherwise fds[*count] will be ANET_ERR and we'll print an
* error and return to the caller with an error. */
@@ -1566,6 +1572,7 @@ int listenToPort(int port, int *fds, int *count) {
server.port, server.neterr);
return REDIS_ERR;
}
+ anetNonBlock(NULL,fds[*count]);
(*count)++;
}
return REDIS_OK;
@@ -1632,6 +1639,7 @@ void initServer() {
redisLog(REDIS_WARNING, "Opening socket: %s", server.neterr);
exit(1);
}
+ anetNonBlock(NULL,server.sofd);
}
/* Abort if there are no listening sockets at all. */