mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 10:02:09 +03:00
check socket() return value
This commit is contained in:
1 parent
bebc109b94
commit
ca5e7fe6f3
1 file changed
+4
-5
+4
-5
@@ -239,12 +239,11 @@ static int nonblocking_socket(struct sslhcfg_protocols_item* proto)
|
||||
}
|
||||
|
||||
int out = socket(proto->saddr->ai_family, SOCK_DGRAM, 0);
|
||||
CHECK_RES_RETURN(out, "udp:socket:socket", -1);
|
||||
|
||||
res = set_nonblock(out);
|
||||
if (res == -1) {
|
||||
print_message(msg_system_error, "%s:%d:%s:%d:%s\n", __FILE__, __LINE__, "udp:socket:nonblock", errno, strerror(errno));
|
||||
close(out);
|
||||
return -1;
|
||||
}
|
||||
CHECK_RES_RETURN(out, "udp:socket:nonblock", -1);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user