diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2008-12-05 01:35:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-04 18:05:41 -0800 |
commit | 47d32af2338418275ab6b53a737952af22289d97 (patch) | |
tree | 1446f6e7851b452c44fd3a90a243aeeccc7dbf67 /builtin-merge.c | |
parent | 123ed6590836405acb4a0c38e2e4c1b06b4e49a9 (diff) | |
download | git-47d32af2338418275ab6b53a737952af22289d97.tar.gz |
Make some of fwrite/fclose/write/close failures visible
So that full filesystem conditions or permissions problems won't go
unnoticed.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index 7c2b90c70b..cf869751b4 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -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); } |