[libav-devel] [PATCH] avutil/file_open: Print debug message if setting close on exec fails

Luca Barbato lu_zero at gentoo.org
Thu Sep 18 06:32:17 CEST 2014


On 18/09/14 06:13, Reinhard Tartler wrote:
> From: Michael Niedermayer <michaelni at gmx.at>
> 
> Fixes CID1087079
> Signed-off-by: Reinhard Tartler <siretart at tauware.de>

Wrong commit message and commit subject.

> ---
>  libavutil/file_open.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavutil/file_open.c b/libavutil/file_open.c
> index 765eb60..019eec5 100644
> --- a/libavutil/file_open.c
> +++ b/libavutil/file_open.c
> @@ -19,6 +19,7 @@
>  #include "config.h"
>  #include "internal.h"
>  #include "mem.h"
> +#include "log.h"
>  #include <stdarg.h>
>  #include <fcntl.h>
>  #include <sys/stat.h>
> @@ -85,8 +86,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");

av_log() without a context is pointless.

> +    }
>  #endif
>  
>      return fd;

lu


More information about the libav-devel mailing list