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>
This commit is contained in:
Thomas Rast
2009-06-27 17:58:46 +02:00
committed by Junio C Hamano
parent f8b5a8e13c
commit d824cbba02
42 changed files with 117 additions and 133 deletions

View File

@ -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);
}
}
}