mirror of
https://github.com/simon987/sist2.git
synced 2025-12-12 15:08:53 +00:00
add fast-epub arg, tweak thread pool, error handling for nftw
This commit is contained in:
@@ -41,6 +41,10 @@ int handle_entry(const char *filepath, const struct stat *info, int typeflag, st
|
||||
|
||||
if (ScanCtx.exclude != NULL && EXCLUDED(filepath)) {
|
||||
LOG_DEBUGF("walk.c", "Excluded: %s", filepath)
|
||||
|
||||
pthread_mutex_lock(&ScanCtx.dbg_file_counts_mu);
|
||||
ScanCtx.dbg_excluded_files_count += 1;
|
||||
pthread_mutex_unlock(&ScanCtx.dbg_file_counts_mu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -51,6 +55,8 @@ int handle_entry(const char *filepath, const struct stat *info, int typeflag, st
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAX_FILE_DESCRIPTORS 64
|
||||
|
||||
int walk_directory_tree(const char *dirpath) {
|
||||
return nftw(dirpath, handle_entry, 15, FTW_PHYS);
|
||||
return nftw(dirpath, handle_entry, MAX_FILE_DESCRIPTORS, FTW_PHYS | FTW_DEPTH);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user