From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: petri.latvala@intel.com
Subject: [igt-dev] [PATCH i-g-t] lib/igt_audio: fix filemode not specified in open(O_CREAT)
Date: Fri, 26 Apr 2019 16:55:40 +0300 [thread overview]
Message-ID: <20190426135540.5878-1-simon.ser@intel.com> (raw)
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
next reply other threads:[~2019-04-26 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 13:55 Simon Ser [this message]
2019-04-26 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_audio: fix filemode not specified in open(O_CREAT) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190426135540.5878-1-simon.ser@intel.com \
--to=simon.ser@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox