X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-help.c;h=e1eba778a526f500b0a65a6b112e468f04a3f869;hb=f7aec129fa78e39e200352502377f57952516f98;hp=af565fb6588a900bca322381af6cbd93ca35d09e;hpb=433e972aeb5e485d2f7a7ac605a1c043822e25d9;p=git.git diff --git a/builtin-help.c b/builtin-help.c index af565fb65..e1eba778a 100644 --- a/builtin-help.c +++ b/builtin-help.c @@ -80,10 +80,9 @@ static int check_emacsclient_version(void) ec_process.argv = argv_ec; ec_process.err = -1; ec_process.stdout_to_stderr = 1; - if (start_command(&ec_process)) { - fprintf(stderr, "Failed to start emacsclient.\n"); - return -1; - } + if (start_command(&ec_process)) + return error("Failed to start emacsclient."); + strbuf_read(&buffer, ec_process.err, 20); close(ec_process.err); @@ -94,20 +93,17 @@ static int check_emacsclient_version(void) finish_command(&ec_process); if (prefixcmp(buffer.buf, "emacsclient")) { - fprintf(stderr, "Failed to parse emacsclient version.\n"); strbuf_release(&buffer); - return -1; + return error("Failed to parse emacsclient version."); } strbuf_remove(&buffer, 0, strlen("emacsclient")); version = atoi(buffer.buf); if (version < 22) { - fprintf(stderr, - "emacsclient version '%d' too old (< 22).\n", - version); strbuf_release(&buffer); - return -1; + return error("emacsclient version '%d' too old (< 22).", + version); } strbuf_release(&buffer); @@ -398,7 +394,7 @@ static void get_html_page_path(struct strbuf *page_path, const char *page) * HTML. */ #ifndef open_html -void open_html(const char *path) +static void open_html(const char *path) { execl_git_cmd("web--browse", "-c", "help.browser", path, NULL); }