mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
coverity 83657 plat unix check setsockopt return
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
d7b0a72953
commit
abb48113e7
1 changed files with 4 additions and 2 deletions
|
@ -227,10 +227,12 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
|||
optval = 1;
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
|
||||
!defined(__OpenBSD__)
|
||||
setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&optval, optlen);
|
||||
if (setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0)
|
||||
return 1;
|
||||
#else
|
||||
tcp_proto = getprotobyname("TCP");
|
||||
setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, &optval, optlen);
|
||||
if (setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, &optval, optlen) < 0)
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
/* We are nonblocking... */
|
||||
|
|
Loading…
Add table
Reference in a new issue