From 46280095033d4f561a6c1d3fcca871ac706073e8 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 19 Jul 2024 22:00:52 -0400 Subject: simulator: A few MULTIVOLUME cleanups in the code. Change-Id: Ia170c06df7624a801ce043e49e078afffa79eee2 --- uisimulator/common/filesystem-sim.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'uisimulator/common/filesystem-sim.c') diff --git a/uisimulator/common/filesystem-sim.c b/uisimulator/common/filesystem-sim.c index df914ebcd7..7a3418021e 100644 --- a/uisimulator/common/filesystem-sim.c +++ b/uisimulator/common/filesystem-sim.c @@ -34,6 +34,7 @@ #include "pathfuncs.h" #include "string-extra.h" #include "debug.h" +#include "mv.h" #ifndef os_fstatat #define USE_OSDIRNAME /* we need to remember the open directory path */ @@ -204,20 +205,20 @@ void sim_ext_extracted(int drive) for (unsigned int i = 0; i < MAX_OPEN_FILES; i++) { struct filestr_desc *filestr = &openfiles[i]; - if (filestr->osfd >= 0 && volume_drive(filestr->volume) == drive) + if (filestr->osfd >= 0 && IF_MV(volume_drive(filestr->volume) == drive)) filestr->mounted = false; } for (unsigned int i = 0; i < MAX_OPEN_DIRS; i++) { struct dirstr_desc *dirstr = &opendirs[i]; - if (dirstr->osdirp && volume_drive(dirstr->volume) == drive) + if (dirstr->osdirp && IF_MV(volume_drive(dirstr->volume) == drive)) dirstr->mounted = false; } (void)drive; } -#endif /* HAVE_MULTIDRIVE */ +#endif /* HAVE_HOTSWAP */ /** * Provides target-like path parsing behavior with single and multiple volumes @@ -314,14 +315,12 @@ int sim_get_os_path(char *buffer, const char *path, size_t bufsize) if (next > p) { - #ifdef HAVE_MULTIDRIVE /* Feign failure if the volume isn't "mounted" */ if (!volume_present(volume)) { errno = ENXIO; return -1; } - #endif /* HAVE_MULTIDRIVE */ sysroot = false; -- cgit v1.2.3