* Fix inotify detection in the root media directory.

* Hold off creating inotify watches until the initial file scan is complete.
* Use a thread instead of fork when scanning.
This commit is contained in:
Justin Maggard
2009-02-17 08:25:15 +00:00
parent 35ce036f3c
commit 14547e2266
7 changed files with 44 additions and 23 deletions

View File

@ -716,3 +716,21 @@ ScanDirectory(const char * dir, const char * parent, enum media_types type)
printf("Scanning %s finished!\n", dir);
}
}
void *
start_scanner()
{
struct media_dir_s * media_path = media_dirs;
scanning = 1;
freopen("/dev/null", "a", stderr);
while( media_path )
{
ScanDirectory(media_path->path, NULL, media_path->type);
media_path = media_path->next;
}
freopen("/proc/self/fd/2", "a", stderr);
scanning = 0;
return 0;
}