mirror of https://git.ffmpeg.org/ffmpeg.git
libavutil: Don't use fcntl if the function does not exist
Not all platforms have the function. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
5f38317e59
commit
87e8cbf709
|
@ -52,8 +52,11 @@ int avpriv_open(const char *filename, int flags, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fd = open(filename, flags, mode);
|
fd = open(filename, flags, mode);
|
||||||
|
#if HAVE_FCNTL
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||||
|
#endif
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue