MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetValidDrive

Function GetValidDrive

pcsx2/CDVD/Darwin/DriveUtility.cpp:78–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void GetValidDrive(std::string& drive)
79{
80 if (!drive.empty())
81 {
82#ifdef __APPLE__
83 int fd = open(drive.c_str(), O_RDONLY | O_NONBLOCK);
84 if (fd != -1)
85 {
86 close(fd);
87 }
88 else
89 {
90 drive.clear();
91 }
92#else
93 drive.clear();
94#endif
95 }
96 if (drive.empty())
97 {
98 auto drives = GetOpticalDriveList();
99 if (!drives.empty())
100 drive = drives.front();
101 }
102 if (!drive.empty())
103 DevCon.WriteLn("CDVD: Opening drive '%s'...", drive.c_str());
104}

Callers

nothing calls this directly

Calls 6

GetOpticalDriveListFunction · 0.70
emptyMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45
frontMethod · 0.45
WriteLnMethod · 0.45

Tested by

no test coverage detected