1
0
Fork 0

Introduce MountType enum for CDROM_GetMountType

This commit is contained in:
Patryk Obara 2019-12-02 11:35:29 +01:00 committed by Patryk Obara
parent f82a0a46da
commit 28dd59e03e
3 changed files with 16 additions and 17 deletions

View file

@ -22,17 +22,14 @@
#include <sys/stat.h>
#include <unistd.h>
#include "dosbox.h"
#include "support.h"
int CDROM_GetMountType(char* path) {
// 1 - Iso file
// 2 - subdirectory
// Detect ISO
MountType CDROM_GetMountType(const char *path) {
struct stat file_stat;
if ((stat(path, &file_stat) == 0) && (file_stat.st_mode & S_IFREG)) return 1;
return 2;
if ((stat(path, &file_stat) == 0) && (file_stat.st_mode & S_IFREG))
return MountType::ISO_IMAGE;
else
return MountType::DIRECTORY;
}
// ******************************************************
@ -73,5 +70,3 @@ bool CDROM_Interface_Fake :: GetMediaTrayStatus(bool& mediaPresent, bool& mediaC
trayOpen = false;
return true;
}