Browse Source

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

Fixes: CID1087075
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
baab248c49
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavformat/network.c

+ 4
- 2
libavformat/network.c View File

@@ -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;


Loading…
Cancel
Save