summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cache.cxx6
-rw-r--r--main.cxx2
2 files changed, 5 insertions, 3 deletions
diff --git a/cache.cxx b/cache.cxx
index ee6d0bf6..b1c7908f 100644
--- a/cache.cxx
+++ b/cache.cxx
@@ -48,6 +48,10 @@ static void clean_cache(systemtap_session& s);
void
add_to_cache(systemtap_session& s)
{
+ // PR10543: clean the cache *before* we try putting something new into it.
+ // We don't want to risk having the brand new contents being erased again.
+ clean_cache(s);
+
string stapconf_src_path = s.tmpdir + "/" + s.stapconf_name;
if (s.verbose > 1)
clog << "Copying " << stapconf_src_path << " to " << s.stapconf_path << endl;
@@ -117,8 +121,6 @@ add_to_cache(systemtap_session& s)
//
// s.use_cache = false;
}
-
- clean_cache(s);
}
diff --git a/main.cxx b/main.cxx
index bc0d7389..15447efc 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1229,7 +1229,7 @@ main (int argc, char * const argv [])
<< endl;
else
{
- // Update cache. Cache cleaning is kicked off at the end of this function.
+ // Update cache. Cache cleaning is kicked off at the beginning of this function.
if (s.use_cache)
add_to_cache(s);