diff --git a/libavformat/network.c b/libavformat/network.c index 4f0486196f..2ba435d472 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -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;