summaryrefslogtreecommitdiffstats
path: root/cache.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-09-28 19:04:00 -0700
committerJosh Stone <jistone@redhat.com>2009-09-28 19:04:00 -0700
commit4e06b5e236b3d281d8be0d7828088e9a8da86e5e (patch)
tree477775a7399911d91f041f4015cc9c3c59cc9f35 /cache.cxx
parente16dc041ec7dbcc83c64533ee4cf8759f6ae0be5 (diff)
downloadsystemtap-steved-4e06b5e236b3d281d8be0d7828088e9a8da86e5e.tar.gz
systemtap-steved-4e06b5e236b3d281d8be0d7828088e9a8da86e5e.tar.xz
systemtap-steved-4e06b5e236b3d281d8be0d7828088e9a8da86e5e.zip
Remove cached signature files along with modules
* cache.cxx (cache_ent_info::cache_ent_info): Count the sgn in the size (cache_ent_info::unlink): Remove the sgn too.
Diffstat (limited to 'cache.cxx')
-rw-r--r--cache.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/cache.cxx b/cache.cxx
index d9a44ea0..8a6553ff 100644
--- a/cache.cxx
+++ b/cache.cxx
@@ -208,9 +208,9 @@ clean_cache(systemtap_session& s)
else
{
//file doesnt exist, create a default size
- ofstream default_cache_max(cache_max_filename.c_str(), ios::out);
- default_cache_max << SYSTEMTAP_CACHE_DEFAULT_MB << endl;
- cache_mb_max = SYSTEMTAP_CACHE_DEFAULT_MB;
+ ofstream default_cache_max(cache_max_filename.c_str(), ios::out);
+ default_cache_max << SYSTEMTAP_CACHE_DEFAULT_MB << endl;
+ cache_mb_max = SYSTEMTAP_CACHE_DEFAULT_MB;
if (s.verbose > 1)
clog << "Cache limit file " << s.cache_path << "/"
@@ -335,8 +335,11 @@ cache_ent_info::cache_ent_info(const string& path, bool is_module):
if (is_module)
{
string mod_path = path + ".ko";
+ string modsgn_path = path + ".ko.sgn";
string source_path = path + ".c";
- size = get_file_size(mod_path) + get_file_size(source_path);
+ size = get_file_size(mod_path)
+ + get_file_size(modsgn_path);
+ + get_file_size(source_path);
weight = get_file_weight(mod_path);
}
else
@@ -353,8 +356,10 @@ cache_ent_info::unlink() const
if (is_module)
{
string mod_path = path + ".ko";
+ string modsgn_path = path + ".ko.sgn";
string source_path = path + ".c";
::unlink(mod_path.c_str());
+ ::unlink(modsgn_path.c_str());
::unlink(source_path.c_str());
}
else