From de701185bf2928d70ce732ab03f04a4a031caaa9 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 16 Mar 2015 22:31:33 +0100 Subject: [PATCH] Wipe the whole cached result on failure retrieving a cached file As suggested by Chiaki ISHIKAWA . --- ccache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ccache.c b/ccache.c index 44383d1bd..5e904d814 100644 --- a/ccache.c +++ b/ccache.c @@ -723,6 +723,14 @@ get_file_from_cache(const char *source, const char *dest) strerror(errno)); stats_update(STATS_ERROR); } + + /* If there was trouble getting a file from the cached result, wipe the + * whole cached result for consistency. */ + x_unlink(cached_stderr); + x_unlink(cached_obj); + x_unlink(cached_dep); + x_unlink(cached_dia); + failed(); } -- 2.47.3