summaryrefslogtreecommitdiff
path: root/hadori.C
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2011-12-02 19:07:31 +0100
committerTimo Weingärtner <timo@tiwe.de>2011-12-02 19:07:31 +0100
commit1c803dcad160e85fe4b8d46b322374283c0edd89 (patch)
tree36e32f32ab64ded6a1038238cecc64b5fbd51c65 /hadori.C
parent568bd7e0d719d7754943c6cfebfa4e4179d62333 (diff)
downloadhadori-1c803dcad160e85fe4b8d46b322374283c0edd89.tar.gz
move kept, to_link, sizes as static into handle_file
only used inside that function
Diffstat (limited to 'hadori.C')
-rw-r--r--hadori.C7
1 files changed, 4 insertions, 3 deletions
diff --git a/hadori.C b/hadori.C
index 093f9a3..3564c04 100644
--- a/hadori.C
+++ b/hadori.C
@@ -18,9 +18,6 @@ namespace po = boost::program_options;
#include "inode.h"
-std::map<ino_t, inode const> kept;
-std::map<ino_t, ino_t> to_link;
-std::multimap<off_t, ino_t> sizes;
po::variables_map config;
std::ostream debug(std::clog.rdbuf()), verbose(std::clog.rdbuf()), error(std::clog.rdbuf());
@@ -47,6 +44,10 @@ void do_link (inode const & i, std::string const & other) {
}
void handle_file(std::string const & path, struct stat const & s) {
+ static std::map<ino_t, inode const> kept;
+ static std::map<ino_t, ino_t> to_link;
+ static std::multimap<off_t, ino_t> sizes;
+
debug << "examining " << path << std::endl;
if (kept.count(s.st_ino)) {
debug << "another link to inode " << s.st_ino << " that we keep" << std::endl;