aboutsummaryrefslogtreecommitdiff
path: root/builtin-tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-07-06 09:39:46 -0700
committerJunio C Hamano <gitster@pobox.com>2009-07-06 09:39:46 -0700
commitdd787c19c4f011cc3adb422ef856f2c58d989640 (patch)
tree1b8fdfb2e14cc423a31ab1ce75c6f05226483da6 /builtin-tag.c
parent864cd9491772367b3ce5b0dda98f068e5bd49680 (diff)
parent0721c314a5c8fddc877140ab5a333c42c62f780d (diff)
downloadgit-dd787c19c4f011cc3adb422ef856f2c58d989640.tar.gz
git-dd787c19c4f011cc3adb422ef856f2c58d989640.tar.xz
Merge branch 'tr/die_errno'
* tr/die_errno: Use die_errno() instead of die() when checking syscalls Convert existing die(..., strerror(errno)) to die_errno() die_errno(): double % in strerror() output just in case Introduce die_errno() that appends strerror(errno) to die()
Diffstat (limited to 'builtin-tag.c')
-rw-r--r--builtin-tag.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin-tag.c b/builtin-tag.c
index 080e04a8f..a51a6d1ea 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -308,8 +308,7 @@ static void create_tag(const unsigned char *object, const char *tag,
path = git_pathdup("TAG_EDITMSG");
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
if (fd < 0)
- die("could not create file '%s': %s",
- path, strerror(errno));
+ die_errno("could not create file '%s'", path);
if (!is_null_sha1(prev))
write_tag_body(fd, prev);
@@ -443,11 +442,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
else {
if (!strcmp(msgfile, "-")) {
if (strbuf_read(&buf, 0, 1024) < 0)
- die("cannot read %s", msgfile);
+ die_errno("cannot read '%s'", msgfile);
} else {
if (strbuf_read_file(&buf, msgfile, 1024) < 0)
- die("could not open or read '%s': %s",
- msgfile, strerror(errno));
+ die_errno("could not open or read '%s'",
+ msgfile);
}
}
}