Commit baab248c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/network: check for fcntl() failure in ff_socket()

Fixes: CID1087075
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 78e6f83c
......@@ -245,8 +245,10 @@ int ff_socket(int af, int type, int proto)
{
fd = socket(af, type, proto);
#if HAVE_FCNTL
if (fd != -1)
fcntl(fd, F_SETFD, FD_CLOEXEC);
if (fd != -1) {
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
av_log(NULL, AV_LOG_DEBUG, "Failed to set close on exec\n");
}
#endif
}
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