From 0721c314a5c8fddc877140ab5a333c42c62f780d Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 27 Jun 2009 17:58:47 +0200 Subject: Use die_errno() instead of die() when checking syscalls Lots of die() calls did not actually report the kind of error, which can leave the user confused as to the real problem. Use die_errno() where we check a system/library call that sets errno on failure, or one of the following that wrap such calls: Function Passes on error from -------- -------------------- odb_pack_keep open read_ancestry fopen read_in_full xread strbuf_read xread strbuf_read_file open or strbuf_read_file strbuf_readlink readlink write_in_full xwrite Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- builtin-add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-add.c') diff --git a/builtin-add.c b/builtin-add.c index c1b229a9d8..8f651c137a 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -220,7 +220,7 @@ int edit_patch(int argc, const char **argv, const char *prefix) launch_editor(file, NULL, NULL); if (stat(file, &st)) - die("Could not stat '%s'", file); + die_errno("Could not stat '%s'", file); if (!st.st_size) die("Empty patch. Aborted."); -- cgit v1.2.1