We look at the modified time of the database and the directory
to decide whether we need to look at only the subdirectories.
ie, if directory modified time is < database modified time
then we have already looking at all the files withing the
directory. So we just need to iterate through the subdirectories
But with symlinks we need to make sure we follow them even if
the directory modified time is less than database modified time
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
/* If this directory hasn't been modified since the last
* add_files, then we only need to look further for
* sub-directories. */
- if (path_mtime <= path_dbtime && entry->d_type != DT_DIR)
+ if (path_mtime <= path_dbtime && entry->d_type == DT_REG)
continue;
/* Ignore special directories to avoid infinite recursion.