diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c index ba5779f26ea..0e9f24e3026 100644 --- a/src/intel/compiler/brw_eu.c +++ b/src/intel/compiler/brw_eu.c @@ -310,7 +310,7 @@ void brw_dump_shader_bin(void *assembly, int start_offset, int end_offset, debug_get_option_shader_bin_dump_path(), identifier); - int fd = open(name, O_CREAT | O_WRONLY, 0777); + int fd = open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644); ralloc_free(name); if (fd < 0) diff --git a/src/intel/compiler/elk/elk_eu.c b/src/intel/compiler/elk/elk_eu.c index 04338026c2a..39381f3200f 100644 --- a/src/intel/compiler/elk/elk_eu.c +++ b/src/intel/compiler/elk/elk_eu.c @@ -376,7 +376,7 @@ void elk_dump_shader_bin(void *assembly, int start_offset, int end_offset, debug_get_option_shader_bin_dump_path(), identifier); - int fd = open(name, O_CREAT | O_WRONLY, 0777); + int fd = open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644); ralloc_free(name); if (fd < 0)