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

@ -252,8 +252,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
}
if (unlink(dest->buf) && errno != ENOENT)
die("failed to unlink %s: %s",
dest->buf, strerror(errno));
die_errno("failed to unlink '%s'", dest->buf);
if (!option_no_hardlinks) {
if (!link(src->buf, dest->buf))
continue;
@ -420,11 +419,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (!option_bare) {
junk_work_tree = work_tree;
if (safe_create_leading_directories_const(work_tree) < 0)
die("could not create leading directories of '%s': %s",
work_tree, strerror(errno));
die_errno("could not create leading directories of '%s'",
work_tree);
if (!dest_exists && mkdir(work_tree, 0755))
die("could not create work tree dir '%s': %s.",
work_tree, strerror(errno));
die_errno("could not create work tree dir '%s'.",
work_tree);
set_git_work_tree(work_tree);
}
junk_git_dir = git_dir;