Commit 579041cd authored by Derek Bonner's avatar Derek Bonner

mmc: mark disk as mounted only after a volume path is available

parent f154d7e7
Pipeline #4557 passed with stage
in 2 minutes and 52 seconds
......@@ -194,10 +194,21 @@ static void iokit_unmount_complete (DADiskRef disk, DADissenterRef dissenter,
static void iokit_mount_complete (DADiskRef disk, DADissenterRef dissenter,
void *context) {
(void) disk; /* suppress warning */
(void) dissenter; /* suppress warning */
if (dissenter) {
Boolean isMountFinished = false;
int waitTime = 0;
BD_DEBUG(DBG_MMC, "Disc mount started, not ready yet\n");
while (!isMountFinished) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, true);
++waitTime;
CFDictionaryRef dict = DADiskCopyDescription(disk);
if (dict) {
isMountFinished = CFDictionaryContainsKey(dict, CFSTR("DAVolumePath"));
}
}
BD_DEBUG(DBG_MMC, "Disc ready after %d seconds\n", waitTime);
}
/* the disc mounts despite whether there is a dessenter */
BD_DEBUG(DBG_MMC, "Disc mounted\n");
((MMCDEV *)context)->is_mounted = 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment