diff --git a/wrapper.c b/wrapper.c index 0349441bde..7c126b87c5 100644 --- a/wrapper.c +++ b/wrapper.c @@ -644,9 +644,7 @@ void write_file(const char *path, const char *fmt, ...) { va_list params; struct strbuf sb = STRBUF_INIT; - int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0666); - if (fd < 0) - die_errno(_("could not open %s for writing"), path); + int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0666); va_start(params, fmt); strbuf_vaddf(&sb, fmt, params);