diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-08 22:30:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-08 22:30:32 +0200 |
commit | 7b062226196c7234818106ab5274b32519e41575 (patch) | |
tree | af74b94d18186099a4a7929968a7691138058735 /builtin/tag.c | |
parent | Merge branch 'dd/diff-files-unmerged-fix' (diff) | |
parent | use xopen() to handle fatal open(2) failures (diff) | |
download | git-7b062226196c7234818106ab5274b32519e41575.tar.xz git-7b062226196c7234818106ab5274b32519e41575.zip |
Merge branch 'rs/xopen-reports-open-failures'
Error diagnostics improvement.
* rs/xopen-reports-open-failures:
use xopen() to handle fatal open(2) failures
xopen: explicitly report creation failures
Diffstat (limited to 'builtin/tag.c')
-rw-r--r-- | builtin/tag.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index 452558ec95..065b6bf093 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -293,9 +293,7 @@ static void create_tag(const struct object_id *object, const char *object_ref, /* write the template message before editing: */ path = git_pathdup("TAG_EDITMSG"); - fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600); - if (fd < 0) - die_errno(_("could not create file '%s'"), path); + fd = xopen(path, O_CREAT | O_TRUNC | O_WRONLY, 0600); if (opt->message_given) { write_or_die(fd, buf->buf, buf->len); |