Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-22 22:26:43 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-23 01:25:35 +0300
commit2fe95f494cde6cb3c3e6894bb687961b28b1764b (patch)
tree3220d3211082b8bde9f21908844a9e6ff218c67b /builtin/log.c
parentbc208ae31417ea4fecad14edcdb8b6c7decb0c38 (diff)
format-patch: notice failure to open cover letter for writing
The make_cover_letter() function is supposed to open a new file for writing, and let the caller write into it via FILE *rev->diffopt.file but because the function does not return anything, the caller does not bother checking the return value. Make sure it dies, instead of keep going with a NULL output filestream and relying on it to cause a crash, when it fails to open the file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 2e4218cb57b..4fc424f1d9d 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1050,7 +1050,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
if (!use_stdout &&
open_next_file(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet))
- return;
+ die(_("failed to create cover-letter file"));
log_write_email_headers(rev, head, &pp.after_subject, &need_8bit_cte, 0);