[FFmpeg-cvslog] lavf/network: check return value of setsockopt.
Jun Zhao
git at videolan.org
Sat Aug 18 12:17:33 EEST 2018
ffmpeg | branch: master | Jun Zhao <mypopydev at gmail.com> | Sun Aug 5 20:19:28 2018 +0800| [0a8ff1d8bb07e8ffbbe5dbdc3885bcd6113188e6] | committer: Jun Zhao
lavf/network: check return value of setsockopt.
Signed-off-by: Jun Zhao <mypopydev at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a8ff1d8bb07e8ffbbe5dbdc3885bcd6113188e6
---
libavformat/network.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavformat/network.c b/libavformat/network.c
index 21c836a0aa..4bae7e2e44 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -194,8 +194,11 @@ int ff_socket(int af, int type, int proto)
#endif
}
#ifdef SO_NOSIGPIPE
- if (fd != -1)
- setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int));
+ if (fd != -1) {
+ if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int))) {
+ av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_NOSIGPIPE) failed\n");
+ }
+ }
#endif
return fd;
}
More information about the ffmpeg-cvslog
mailing list