builtin/help.c: use warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
May 8, 2016 at 16:47 UTC
574774980cfdfe72d77cec831024f0229d10a1f3
1 file changed
+4
-4
builtin/help.c
+4
-4
@@ -127,7 +127,7 @@ static void exec_woman_emacs(const char *path, const char *page)
127
path = "emacsclient";
128
strbuf_addf(&man_page, "(woman \"%s\")", page);
129
execlp(path, "emacsclient", "-e", man_page.buf, (char *)NULL);
130
- warning(_("failed to exec '%s': %s"), path, strerror(errno));
130
+ warning_errno(_("failed to exec '%s'"), path);
131
}
132
}
133
@@ -148,7 +148,7 @@ static void exec_man_konqueror(const char *path, const char *page)
148
path = "kfmclient";
149
strbuf_addf(&man_page, "man:%s(1)", page);
150
execlp(path, filename, "newTab", man_page.buf, (char *)NULL);
151
- warning(_("failed to exec '%s': %s"), path, strerror(errno));
151
+ warning_errno(_("failed to exec '%s'"), path);
152
}
153
}
154
@@ -157,7 +157,7 @@ static void exec_man_man(const char *path, const char *page)
157
if (!path)
158
path = "man";
159
execlp(path, "man", page, (char *)NULL);
160
- warning(_("failed to exec '%s': %s"), path, strerror(errno));
160
+ warning_errno(_("failed to exec '%s'"), path);
161
}
162
163
static void exec_man_cmd(const char *cmd, const char *page)
@@ -165,7 +165,7 @@ static void exec_man_cmd(const char *cmd, const char *page)
165
struct strbuf shell_cmd = STRBUF_INIT;
166
strbuf_addf(&shell_cmd, "%s %s", cmd, page);
167
execl(SHELL_PATH, SHELL_PATH, "-c", shell_cmd.buf, (char *)NULL);
168
- warning(_("failed to exec '%s': %s"), cmd, strerror(errno));
168
+ warning(_("failed to exec '%s'"), cmd);
169
}
170
171
static void add_man_viewer(const char *name)