]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Improve compiler detection error message
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 18:02:37 +0000 (20:02 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 18:02:37 +0000 (20:02 +0200)
ccache.c

index fe229814f1c69230b259860a6e9c24dec6cf5da1..fbc8555cac1a566b16d011b81894356b3d9b8ebe 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1138,6 +1138,7 @@ static void find_compiler(int argc, char **argv)
 {
        char *base;
        char *path;
+       char *compiler;
 
        orig_args = args_init(argc, argv);
 
@@ -1159,14 +1160,14 @@ static void find_compiler(int argc, char **argv)
                base = strdup(path);
        }
 
-       orig_args->argv[0] = find_executable(base, MYNAME);
+       compiler = find_executable(base, MYNAME);
 
        /* can't find the compiler! */
-       if (!orig_args->argv[0]) {
+       if (!compiler) {
                stats_update(STATS_COMPILER);
-               perror(base);
-               exit(1);
+               fatal("Could not find compiler \"%s\" in PATH", base);
        }
+       orig_args->argv[0] = compiler;
 }