[igt-dev] [PATCH i-g-t] lib/audio: Fix compiler error with missing permsisions to O_CREAT.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Apr 29 09:24:37 UTC 2019


In file included from /usr/include/fcntl.h:290:0,
                 from ../../lib/igt_audio.c:30:
In function ‘open’,
    inlined from ‘audio_create_wav_file_s32_le’ at igt_audio.c:450:5:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to
	‘__open_missing_mode’ declared with attribute error: open with
	O_CREAT or O_TMPFILE in second argument needs 3 arguments
    __open_missing_mode ();
    ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Simon Ser <simon.ser at intel.com>
Cc: Martin Peres <martin.peres at linux.intel.com>
---
 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 5b0860e6cc76..fd8cf07c0de3 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.20.1



More information about the igt-dev mailing list