From: Joel Rosdahl Date: Wed, 14 Jul 2010 13:55:08 +0000 (+0200) Subject: Call fatal() instead of exit(1) where appropriate X-Git-Tag: v3.1~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5bfe8605200143b905b2d0f80b3a344579de93b;p=thirdparty%2Fccache.git Call fatal() instead of exit(1) where appropriate --- diff --git a/ccache.c b/ccache.c index ce0f1d97d..b97fa6b3c 100644 --- a/ccache.c +++ b/ccache.c @@ -275,8 +275,7 @@ static void failed(void) if ((e=getenv("CCACHE_PREFIX"))) { char *p = find_executable(e, MYNAME); if (!p) { - perror(e); - exit(1); + fatal("%s: %s", e, strerror(errno)); } args_add_prefix(orig_args, p); } @@ -284,9 +283,7 @@ static void failed(void) cc_log("Failed; falling back to running the real compiler"); cc_log_executed_command(orig_args->argv); execv(orig_args->argv[0], orig_args->argv); - cc_log("execv returned (%s)!", strerror(errno)); - perror(orig_args->argv[0]); - exit(1); + fatal("%s: execv returned (%s)", orig_args->argv[0], strerror(errno)); } /* @@ -1989,8 +1986,7 @@ static void ccache(int argc, char *argv[]) if (env) { char *p = find_executable(env, MYNAME); if (!p) { - perror(env); - exit(1); + fatal("%s: %s", env, strerror(errno)); } cc_log("Using command-line prefix %s", env); args_add_prefix(compiler_args, p);