aboutsummaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index 644d49f..1af8e7c 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -123,7 +123,7 @@ int socket_accept_in(const psocket *psock, psocket *client_psock)
&client_psock->addr_len);
if (fd < 0)
return 1;
- if (socket_nonblock(psock))
+ if (socket_setopts(fd) || socket_nonblock(psock))
{
close(fd);
return 1;
@@ -154,7 +154,8 @@ int socket_connect_in(psocket *psock, struct addrinfo **results)
if (!rp)
goto finalise;
- if (socket_setopts(fd))
+ s = socket_setopts(fd);
+ if (s)
goto finalise;
psock->fd = fd;