From d824cbba02a4061400a0e382f9bd241fbbff34f0 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 27 Jun 2009 17:58:46 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- builtin-blame.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'builtin-blame.c') diff --git a/builtin-blame.c b/builtin-blame.c index 0c2d29a430..7d8fbd5919 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -2035,7 +2035,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con contents_from = "standard input"; mode = 0; if (strbuf_read(&buf, 0, 0) < 0) - die("read error %s from stdin", strerror(errno)); + die_errno("failed to read from stdin"); } convert_to_git(path, buf.buf, buf.len, &buf, 0); origin->file.ptr = buf.buf; @@ -2261,8 +2261,7 @@ parse_done: argc = parse_options_end(&ctx); if (revs_file && read_ancestry(revs_file)) - die("reading graft file %s failed: %s", - revs_file, strerror(errno)); + die_errno("reading graft file '%s' failed", revs_file); if (cmd_is_annotate) { output_option |= OUTPUT_ANNOTATE_COMPAT; @@ -2350,7 +2349,7 @@ parse_done: setup_work_tree(); if (!has_string_in_work_tree(path)) - die("cannot stat path %s: %s", path, strerror(errno)); + die_errno("cannot stat path '%s'", path); } setup_revisions(argc, argv, &revs, NULL); -- cgit v1.2.3