From 24e6033df724ded801bcfc5ae72148dbb9c0d16b Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 9 May 2010 20:03:08 +0200 Subject: [PATCH] Detect recursive execution of ccache due to misnamed ccache binary --- ccache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ccache.c b/ccache.c index fbc8555ca..1c25f7247 100644 --- a/ccache.c +++ b/ccache.c @@ -1167,6 +1167,10 @@ static void find_compiler(int argc, char **argv) stats_update(STATS_COMPILER); fatal("Could not find compiler \"%s\" in PATH", base); } + if (strcmp(compiler, argv[0]) == 0) { + fatal("Recursive invocation (the name of the ccache binary" + " must be \"%s\")", MYNAME); + } orig_args->argv[0] = compiler; } -- 2.47.3