diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2009-12-12 21:27:11 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2010-01-05 18:53:03 +0100 |
commit | 59eb6b9fc3c3835328ff1aa828bd234b8ce72de0 (patch) | |
tree | f4b1da999b5a4deafa4fa518e7ac12e18b1ef203 /cleanup.c | |
parent | 5de11867ce6efd5ab45746184b0c19faa2b49e75 (diff) | |
download | ccache-59eb6b9fc3c3835328ff1aa828bd234b8ce72de0.tar.gz |
Don't create empty stderr files in the cache
Diffstat (limited to 'cleanup.c')
-rw-r--r-- | cleanup.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -129,8 +129,21 @@ static void sort_and_clean(void) } if (is_object_file(files[i]->fname)) { + char *path; + total_object_files -= 1; total_object_size -= files[i]->size; + + /* + * If we have deleted an object file, we should delete + * any .stderr and .d file as well. + */ + x_asprintf(&path, "%s.stderr", files[i]->fname); + unlink(path); + free(path); + x_asprintf(&path, "%s.d", files[i]->fname); + unlink(path); + free(path); } } } |