[igt-dev] [PATCH i-g-t] lib/igt_audio: fix filemode not specified in open(O_CREAT)

Chris Wilson chris at chris-wilson.co.uk
Fri Apr 26 20:13:07 UTC 2019


Quoting Simon Ser (2019-04-26 14:55:40)
> open(3) takes va_args after the flags and O_CREAT will read the first one. If
> we don't provide one, this is undefined behaviour.
> 
> (Someone reported it broke the build for them)
> 
> Signed-off-by: Simon Ser <simon.ser at intel.com>
> Fixes: 311baff151f90c1db6f57ee9515216b4f9da5db7
> ---
>  lib/igt_audio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_audio.c b/lib/igt_audio.c
> index 5b0860e6..fd8cf07c 100644
> --- a/lib/igt_audio.c
> +++ b/lib/igt_audio.c
> @@ -447,7 +447,7 @@ int audio_create_wav_file_s32_le(const char *qualifier, uint32_t sample_rate,
>                 *path = strdup(_path);
>  
>         igt_debug("Dumping %s audio to %s\n", qualifier, _path);
> -       fd = open(_path, O_WRONLY | O_CREAT | O_TRUNC);
> +       fd = open(_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);

Ok,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list