aboutsummaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index 1af8e7c..6713d10 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -123,12 +123,17 @@ int socket_accept_in(const psocket *psock, psocket *client_psock)
&client_psock->addr_len);
if (fd < 0)
return 1;
- if (socket_setopts(fd) || socket_nonblock(psock))
+ if (socket_setopts(fd))
{
close(fd);
return 1;
}
+
client_psock->fd = fd;
+ if (socket_nonblock(client_psock)) {
+ socket_close(client_psock);
+ return 1;
+ }
return 0;
}