Commit 33f53ab0 authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot

Don't ignore setsockopt return value

PUBLISHED_FROM=f3c1fcf015f6f72eca2eb3d5dad469cd66a837a9
parent bd15ad43
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment