public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_audio: fix filemode not specified in open(O_CREAT)
@ 2019-04-26 13:55 Simon Ser
  2019-04-26 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Ser @ 2019-04-26 13:55 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

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: 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);
 	if (fd < 0) {
 		igt_warn("open failed: %s\n", strerror(errno));
 		return -1;
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-26 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-26 13:55 [igt-dev] [PATCH i-g-t] lib/igt_audio: fix filemode not specified in open(O_CREAT) Simon Ser
2019-04-26 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-26 19:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-26 20:13 ` [igt-dev] [PATCH i-g-t] " Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox