* ReadyNAS-specific change to remove any leftover scanning flag files when we start.

This commit is contained in:
Justin Maggard
2009-05-03 18:32:48 +00:00
parent 7c64eb10ac
commit 0229ee64ee
2 changed files with 6 additions and 5 deletions

View File

@ -610,6 +610,7 @@ main(int argc, char * * argv)
#ifdef READYNAS #ifdef READYNAS
DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA...\n"); DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA...\n");
unlink("/ramfs/.upnp-av_scan");
#else #else
DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA...\n"); DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA...\n");
#endif #endif

View File

@ -787,11 +787,6 @@ ScanDirectory(const char * dir, const char * parent, enum media_types type)
if( !parent ) if( !parent )
{ {
startID = get_next_available_id("OBJECTS", BROWSEDIR_ID); startID = get_next_available_id("OBJECTS", BROWSEDIR_ID);
#ifdef READYNAS
FILE * flag = fopen("/ramfs/.upnp-av_scan", "w");
if( flag )
fclose(flag);
#endif
} }
for (i=0; i < n; i++) { for (i=0; i < n; i++) {
@ -831,6 +826,11 @@ start_scanner()
if (setpriority(PRIO_PROCESS, 0, 15) == -1) if (setpriority(PRIO_PROCESS, 0, 15) == -1)
DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce scanner thread priority\n"); DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce scanner thread priority\n");
#ifdef READYNAS
FILE * flag = fopen("/ramfs/.upnp-av_scan", "w");
if( flag )
fclose(flag);
#endif
scanning = 1; scanning = 1;
freopen("/dev/null", "a", stderr); freopen("/dev/null", "a", stderr);
while( media_path ) while( media_path )