From: Michael Niedermayer <[email protected]>
Fixes CID1087079
Signed-off-by: Reinhard Tartler <[email protected]>
---
libavutil/file_open.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavutil/file_open.c b/libavutil/file_open.c
index 765eb60..019eec5 100644
--- a/libavutil/file_open.c
+++ b/libavutil/file_open.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "internal.h"
#include "mem.h"
+#include "log.h"
#include <stdarg.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -85,8 +86,10 @@ int avpriv_open(const char *filename, int flags, ...)
fd = open(filename, flags, mode);
#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;
--
2.1.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel