From: Joel Rosdahl Date: Sat, 30 Jan 2010 14:38:25 +0000 (+0100) Subject: Remove stderr file from the preprocessor when we get a preprocessed cache hit X-Git-Tag: v3.0pre0~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd0cd87c6b1dbf129505a41393a3da064efeca07;p=thirdparty%2Fccache.git Remove stderr file from the preprocessor when we get a preprocessed cache hit --- diff --git a/ccache.c b/ccache.c index 80bfee5dd..84f1fb2e5 100644 --- a/ccache.c +++ b/ccache.c @@ -492,6 +492,7 @@ static void to_cache(ARGS *args) close(fd_result); unlink(cpp_stderr); free(cpp_stderr); + cpp_stderr = NULL; } if (status != 0) { @@ -987,6 +988,13 @@ static void from_cache(enum fromcache_call_mode mode, int put_object_in_manifest i_tmpfile = NULL; } + /* Delete the cpp stderr file if necessary. */ + if (cpp_stderr) { + unlink(cpp_stderr); + free(cpp_stderr); + cpp_stderr = NULL; + } + /* Send the stderr, if any. */ fd_stderr = open(stderr_file, O_RDONLY | O_BINARY); if (fd_stderr != -1) { diff --git a/test.sh b/test.sh index c5436c74a..f583bddaa 100755 --- a/test.sh +++ b/test.sh @@ -65,7 +65,13 @@ checkfile() { run_suite() { echo "starting testsuite $1" testsuite=$1 + ${1}_suite + + testname="the tmp directory should be empty" + if [ "`find $CCACHE_DIR/tmp -type f | wc -l`" -gt 0 ]; then + test_failed "$CCACHE_DIR/tmp is not empty" + fi } base_tests() {