mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-26 20:38:25 +00:00
Don't ignore setsockopt return value
PUBLISHED_FROM=f3c1fcf015f6f72eca2eb3d5dad469cd66a837a9
This commit is contained in:
1 parent
bd15ad4301
commit
33f53ab000
1 file changed
+5
-2
+5
-2
@@ -3450,8 +3450,11 @@ void mg_socket_if_connect_udp(struct mg_connection *nc) {
|
|||||||
}
|
}
|
||||||
if (nc->flags & MG_F_ENABLE_BROADCAST) {
|
if (nc->flags & MG_F_ENABLE_BROADCAST) {
|
||||||
int optval = 1;
|
int optval = 1;
|
||||||
setsockopt(nc->sock, SOL_SOCKET, SO_BROADCAST, (const char *) &optval,
|
if (setsockopt(nc->sock, SOL_SOCKET, SO_BROADCAST, (const char *) &optval,
|
||||||
sizeof(optval));
|
sizeof(optval)) < 0) {
|
||||||
|
nc->err = mg_get_errno() ? mg_get_errno() : 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nc->err = 0;
|
nc->err = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user