From ae19e2305e378f17a968affb8ec40c4a05f5548a Mon Sep 17 00:00:00 2001 From: Tobias Zagorni Date: Wed, 7 Apr 2021 15:49:27 +0200 Subject: [PATCH] make debug output optional --- src/partition.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/partition.cpp b/src/partition.cpp index 8e4cf7c..d3eb58f 100644 --- a/src/partition.cpp +++ b/src/partition.cpp @@ -22,7 +22,9 @@ void Partition::scanDir(string dirname) while ((entry = readdir(dir)) != NULL) { string name = entry->d_name; +#ifdef DEBUG_SCAN cout << "Found file " << entry->d_name << ".\n"; +#endif if (checkExtension(name, ".dtbootmenu")) { Entry entry = EntryFile(path, dirname, name).parse(); @@ -46,14 +48,20 @@ Partition::Partition(string _path) void Partition::scan(vector directories) { +#ifdef DEBUG_SCAN cout << "Scanning " + path + "\n"; +#endif if (mount(path.c_str(), "/tmpmount", "ext4", MS_RDONLY, "") == 0) { +#ifdef DEBUG_SCAN cout << "Found supported file system on " + path + ".\n"; +#endif for (string &d: directories) { +#ifdef DEBUG_SCAN cout << "Scanning " + d + " on " + path + "\n"; +#endif scanDir("/tmpmount/" + d); }