Skip to content

Commit

Permalink
Wipe the whole cached result on failure retrieving a cached file
Browse files Browse the repository at this point in the history
As suggested by Chiaki ISHIKAWA <[email protected]>.
  • Loading branch information
jrosdahl committed Mar 16, 2015
1 parent 7493e7c commit de70118
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ccache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit de70118

Please sign in to comment.