Skip to content

Commit eb9e472

Browse files
committed
fixup more stuff for open() instead of fopen_on_write()
1 parent ed10318 commit eb9e472

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bugreport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ int cmd_main(int argc, const char **argv)
334334
{
335335
struct strbuf buffer = STRBUF_INIT;
336336
struct strbuf report_path = STRBUF_INIT;
337-
int report;
337+
int report = -1;
338338
time_t now = time(NULL);
339339
char *option_output = NULL;
340340
char *option_suffix = "%F-%H%M";
@@ -396,11 +396,11 @@ int cmd_main(int argc, const char **argv)
396396
get_alternates_summary(&buffer, nongit_ok);
397397

398398
/* fopen doesn't offer us an O_EXCL alternative, except with glibc. */
399-
report = open(report_path.buf, O_CREAT | O_EXCL | O_WRONLY);
399+
report = open(report_path.buf, O_CREAT | O_EXCL | O_WRONLY, 0666);
400400

401401
if (report < 0) {
402402
UNLEAK(report_path);
403-
die("couldn't open '%s' for writing", report_path.buf);
403+
die(_("couldn't create a new file at '%s'"), report_path.buf);
404404
}
405405

406406
strbuf_write_fd(&buffer, report);

0 commit comments

Comments
 (0)