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

4
diff.c
View File

@ -1975,7 +1975,7 @@ static void prep_temp_blob(const char *path, struct diff_tempfile *temp,
fd = git_mkstemps(temp->tmp_path, PATH_MAX, template.buf,
strlen(base) + 1);
if (fd < 0)
die("unable to create temp-file: %s", strerror(errno));
die_errno("unable to create temp-file");
if (convert_to_working_tree(path,
(const char *)blob, (size_t)size, &buf)) {
blob = buf.buf;
@ -2021,7 +2021,7 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
if (lstat(name, &st) < 0) {
if (errno == ENOENT)
goto not_a_valid_file;
die("stat(%s): %s", name, strerror(errno));
die_errno("stat(%s)", name);
}
if (S_ISLNK(st.st_mode)) {
struct strbuf sb = STRBUF_INIT;