Re: [PATCH v2 08/41] builtin/mailsplit.c: use error_errno()
From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:09
Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c - error("cannot opendir %s (%s)", name, strerror(errno)); + error_errno("cannot opendir %s", name); - error("cannot open mail %s (%s)", file, strerror(errno)); + error_errno("cannot open mail %s", file); - error("cannot read mail %s (%s)", file, strerror(errno)); + error_errno("cannot read mail %s", file); - error("cannot stat %s (%s)", arg, strerror(errno)); + error_errno("cannot stat %s", arg);
These all used to use its own formatting, but will use "<message>: <errno>" format like everybody else, which is good.
quoted hunk
@@ -210,7 +210,7 @@ static int split_mbox(const char *file, const char *dir, int allow_bare, int file_done = 0; if (!f) { - error("cannot open mbox %s", file); + error_errno("cannot open mbox %s", file); goto out; }
It may be a bit unclear from the context, but it uses errno that was set when fopen() returned a NULL. The changes in this patch are not faithful conversion like other patches, but they are all good, I would say. Thanks.