summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-04-26 16:55:40 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-04-29 17:27:30 +0300
commitab54de9937678583437eee4546bc25a9885b87a6 (patch)
treebd478c4a87180c9e1de877ef7df0eb0335aeb713
parentb3fe990dd7ef25fa8f8e47b04fb7522942c6668d (diff)
lib/igt_audio: fix filemode not specified in open(O_CREAT)
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@intel.com> Fixes: 311baff151f9 ("tests/kms_chamelium: add dp-audio test") Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--lib/igt_audio.c2
1 files changed, 1 insertions, 1 deletions
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);
if (fd < 0) {
igt_warn("open failed: %s\n", strerror(errno));
return -1;