Merge branch 'maint'
[gitweb.git] / builtin-merge.c
index 7c2b90c70baed2c7f008c2b98ad26135ef12db00..cf869751b41c256363bf5f0c465e46684e2920b8 100644 (file)
@@ -293,8 +293,10 @@ static void squash_message(void)
                pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
                        NULL, NULL, rev.date_mode, 0);
        }
-       write(fd, out.buf, out.len);
-       close(fd);
+       if (write(fd, out.buf, out.len) < 0)
+               die("Writing SQUASH_MSG: %s", strerror(errno));
+       if (close(fd))
+               die("Finishing SQUASH_MSG: %s", strerror(errno));
        strbuf_release(&out);
 }