// return "true" when game was changed bool SetGameDir(const char *name) { guard(CQuakeFileSystem::SetGameDir); FSLog->Printf("Set gamedir: %s\n", name); if (!name[0]) name = BASEDIRNAME; if (!stricmp(GameDir, name)) return false; // not changed // check directory CFileList *list = List(va("./%s/*", name), FS_DIR|FS_FILE|FS_OS, NULL); bool empty = !(*list); delete list; if (empty) { appWPrintf("Invalid game directory: %s\n", name); return false; } if (GameDir != BASEDIRNAME) // base dir not umounted { Umount(va("./%s/*." PAK_EXTENSION, *GameDir)); if (fs_cddir->string[0]) Umount(va("%s/%s/*." PAK_EXTENSION, fs_cddir->string, *GameDir)); } GameDir.filename(name); GDefMountPoint = GameDir; if (GameDir != BASEDIRNAME) // do not remount base dir MountGame(name); return true; unguard; }
int CHugePageManager::Close() { // if map as a whole mode if (m_Addr != NULL) { munmap(m_Addr, m_Page_Size * m_Page_Numbers); m_Addr = NULL; } UMapAllPages(); UMapRePages(); Umount(); Opened = false; printf("hugepage closed sucessfully\n"); return 0; }
CDiskDrive::~CDiskDrive() { CLockMgr<CCSWrapper> guard( m_Lock, TRUE ); Umount(); }