libavutil: Don't use fcntl if the function does not exist
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 7 Aug 2013 23:44:37 +0000 (19:44 -0400)
committerMartin Storsjö <martin@martin.st>
Thu, 8 Aug 2013 08:07:51 +0000 (11:07 +0300)
Not all platforms have the function.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/file.c

index add049d..9ce0dc5 100644 (file)
@@ -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;
 }