Skip to content

Commit

Permalink
make debug output optional
Browse files Browse the repository at this point in the history
  • Loading branch information
zagto committed Apr 7, 2021
1 parent 7ec5f6a commit ae19e23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -46,14 +48,20 @@ Partition::Partition(string _path)

void Partition::scan(vector<string> 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);
}

Expand Down

0 comments on commit ae19e23

Please sign in to comment.