]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bugreport.c
Merge branch 'jk/refspecs-cleanup'
[thirdparty/git.git] / bugreport.c
index 28f4568b01f28bbbb8e6de4c07c92947533e6ef7..7ca0fba1b8ed46a86290bd6ed966cb9aa8233de6 100644 (file)
@@ -175,12 +175,12 @@ int cmd_main(int argc, const char **argv)
        /* fopen doesn't offer us an O_EXCL alternative, except with glibc. */
        report = open(report_path.buf, O_CREAT | O_EXCL | O_WRONLY, 0666);
 
-       if (report < 0) {
-               UNLEAK(report_path);
+       if (report < 0)
                die(_("couldn't create a new file at '%s'"), report_path.buf);
-       }
 
-       strbuf_write_fd(&buffer, report);
+       if (write_in_full(report, buffer.buf, buffer.len) < 0)
+               die_errno(_("unable to write to %s"), report_path.buf);
+
        close(report);
 
        /*