]> git.sesse.net Git - ffmpeg/commitdiff
avutil/file_open: Print debug message if setting close on exec fails
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 16:36:09 +0000 (18:36 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 16:36:09 +0000 (18:36 +0200)
Fixes CID1087079
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/file_open.c

index ddb1c513856705ab5d166c000389d24cb8674f64..389076fca164d590975bf91253e901c8f2f8b7d2 100644 (file)
@@ -85,8 +85,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;