diff options
author | Thomas Rast <trast@student.ethz.ch> | 2009-06-27 19:58:46 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-27 22:14:53 +0400 |
commit | d824cbba02a4061400a0e382f9bd241fbbff34f0 (patch) | |
tree | ae0c9be6c2778dd10c4cc207957e346855bd4418 /builtin-tag.c | |
parent | f8b5a8e13cb4d60c8b630f92a8f07590ef218ec5 (diff) |
Convert existing die(..., strerror(errno)) to die_errno()
Change calls to die(..., strerror(errno)) to use the new die_errno().
In the process, also make slight style adjustments: at least state
_something_ about the function that failed (instead of just printing
the pathname), and put paths in single quotes.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-tag.c')
-rw-r--r-- | builtin-tag.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin-tag.c b/builtin-tag.c index dc3db62811..7b51095c80 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); @@ -446,8 +445,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix) die("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); } } } |