From ad28fe35c55bb0351c8986812f43280430162a12 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 20 Oct 2013 18:36:09 +0200 Subject: avutil/file_open: Print debug message if setting close on exec fails Fixes CID1087079 Signed-off-by: Michael Niedermayer --- libavutil/file_open.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libavutil/file_open.c') diff --git a/libavutil/file_open.c b/libavutil/file_open.c index ddb1c51385..389076fca1 100644 --- a/libavutil/file_open.c +++ b/libavutil/file_open.c @@ -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; -- cgit v1.2.3