don't try to run diskutil eject (null)

This commit is contained in:
Alexei Svitkine 2018-01-01 15:42:53 -05:00
parent 62eaaee1b2
commit 588a2ae9cd

10
BasiliskII/src/Unix/sys_unix.cpp Normal file → Executable file
View File

@ -883,10 +883,12 @@ void SysEject(void *arg)
// Try to use "diskutil eject" but it can take up to 5 // Try to use "diskutil eject" but it can take up to 5
// seconds to complete // seconds to complete
static const char eject_cmd[] = "/usr/sbin/diskutil eject %s 2>&1 >/dev/null"; if (fh->ioctl_name) {
char *cmd = (char *)alloca(strlen(eject_cmd) + strlen(fh->ioctl_name) + 1); static const char eject_cmd[] = "/usr/sbin/diskutil eject %s 2>&1 >/dev/null";
sprintf(cmd, eject_cmd, fh->ioctl_name); char *cmd = (char *)alloca(strlen(eject_cmd) + strlen(fh->ioctl_name) + 1);
system(cmd); sprintf(cmd, eject_cmd, fh->ioctl_name);
system(cmd);
}
} }
fh->is_media_present = false; fh->is_media_present = false;
} }