Skip to content

Commit

Permalink
Performance/bug fix in media monitor ScanMediaType().
Browse files Browse the repository at this point in the history
Symlinks to other places (like /Applications on OS X disk images) can cause
unwanted scanning of irrelevant directories and a big performance hit.
Even worse is symlinks which point to themselves, or a parent directory,
which recurse forever and blow the stack. If anyone really thinks that symlinks
should be used in file counts, we can revisit and add recursion limit rules?
  • Loading branch information
NigelPearson committed Mar 16, 2012
1 parent 19fa996 commit 01177a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mythtv/libs/libmythbase/mythmedia.cpp
Expand Up @@ -261,6 +261,9 @@ bool MythMediaDevice::ScanMediaType(const QString &directory, ext_cnt_t &cnt)
if (("." == fi.fileName()) || (".." == fi.fileName()))
continue;

if (fi.isSymLink())
continue;

if (fi.isDir())
{
ScanMediaType(fi.absoluteFilePath(), cnt);
Expand Down

0 comments on commit 01177a3

Please sign in to comment.