summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavutil/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index add049d24b..9ce0dc5e01 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -52,8 +52,11 @@ int avpriv_open(const char *filename, int flags, ...)
#endif
fd = open(filename, flags, mode);
+#if HAVE_FCNTL
if (fd != -1)
fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
+
return fd;
}