diff --git a/firmware/common/dir_uncached.c b/firmware/common/dir_uncached.c index e4c4397..5d43166 100644 --- a/firmware/common/dir_uncached.c +++ b/firmware/common/dir_uncached.c @@ -36,7 +36,7 @@ static DIR_UNCACHED opendirs[MAX_OPEN_DIRS]; -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) || defined(USE_ROCKBOX_USB) || (!defined(USB_NONE) && !defined(HAVE_USBSTACK)) // release all dir handles on a given volume "by force", to avoid leaks int release_dirs(int volume) { @@ -57,7 +57,7 @@ int release_dirs(int volume) } return closed; /* return how many we did */ } -#endif /* #ifdef HAVE_HOTSWAP */ +#endif /* #if defined(HAVE_HOTSWAP) || defined(USE_ROCKBOX_USB) || (!defined(USB_NONE) && !defined(HAVE_USBSTACK)) */ DIR_UNCACHED* opendir_uncached(const char* name) { diff --git a/firmware/common/disk.c b/firmware/common/disk.c index 6be9b47..ee7d34c 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -23,7 +23,7 @@ #include "storage.h" #include "debug.h" #include "fat.h" -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) || defined(USE_ROCKBOX_USB) || (!defined(USB_NONE) && !defined(HAVE_USBSTACK)) #include "dir.h" /* for release_dirs() */ #include "file.h" /* for release_files() */ #endif @@ -235,12 +235,14 @@ int disk_mount(int drive) return mounted; } -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) || defined(USE_ROCKBOX_USB) || (!defined(USB_NONE) && !defined(HAVE_USBSTACK)) int disk_unmount(int drive) { int unmounted = 0; int i; +#ifdef HAVE_HOTSWAP mutex_lock(&disk_mutex); +#endif for (i=0; i