Commit 0a8ff1d8 authored by Jun Zhao's avatar Jun Zhao Committed by Jun Zhao

lavf/network: check return value of setsockopt.

Signed-off-by: 's avatarJun Zhao <mypopydev@gmail.com>
parent d428ef0e
...@@ -194,8 +194,11 @@ int ff_socket(int af, int type, int proto) ...@@ -194,8 +194,11 @@ int ff_socket(int af, int type, int proto)
#endif #endif
} }
#ifdef SO_NOSIGPIPE #ifdef SO_NOSIGPIPE
if (fd != -1) if (fd != -1) {
setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int)); if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int))) {
av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_NOSIGPIPE) failed\n");
}
}
#endif #endif
return fd; return fd;
} }
......
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