mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 19:19:00 +08:00
Don't ignore setsockopt return value
PUBLISHED_FROM=f3c1fcf015f6f72eca2eb3d5dad469cd66a837a9
This commit is contained in:
parent
bd15ad4301
commit
33f53ab000
@ -3450,8 +3450,11 @@ void mg_socket_if_connect_udp(struct mg_connection *nc) {
|
||||
}
|
||||
if (nc->flags & MG_F_ENABLE_BROADCAST) {
|
||||
int optval = 1;
|
||||
setsockopt(nc->sock, SOL_SOCKET, SO_BROADCAST, (const char *) &optval,
|
||||
sizeof(optval));
|
||||
if (setsockopt(nc->sock, SOL_SOCKET, SO_BROADCAST, (const char *) &optval,
|
||||
sizeof(optval)) < 0) {
|
||||
nc->err = mg_get_errno() ? mg_get_errno() : 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
nc->err = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user