From: Joel Rosdahl Date: Mon, 16 Mar 2015 21:31:33 +0000 (+0100) Subject: Wipe the whole cached result on failure retrieving a cached file X-Git-Tag: v3.2.2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de701185bf2928d70ce732ab03f04a4a031caaa9;p=thirdparty%2Fccache.git Wipe the whole cached result on failure retrieving a cached file As suggested by Chiaki ISHIKAWA . --- 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(); }