diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/cross_osx.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 8d15e46b5..8ae8cf087 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -256,19 +256,17 @@ get_model (CFDictionaryRef& description) } -static optional<boost::filesystem::path> -mount_point (CFDictionaryRef& description) +static +bool +is_mounted(CFDictionaryRef& description) { auto volume_path_key = (CFURLRef) CFDictionaryGetValue (description, kDADiskDescriptionVolumePathKey); if (!volume_path_key) { - return {}; + return false; } char mount_path_buffer[1024]; - if (!CFURLGetFileSystemRepresentation(volume_path_key, false, (UInt8 *) mount_path_buffer, sizeof(mount_path_buffer))) { - return {}; - } - return boost::filesystem::path(mount_path_buffer); + return CFURLGetFileSystemRepresentation(volume_path_key, false, (UInt8 *) mount_path_buffer, sizeof(mount_path_buffer)); } @@ -306,7 +304,7 @@ disk_appeared (DADiskRef disk, void* context) this_disk.model = get_model (description); LOG_DISK("Vendor/model: %1 %2", this_disk.vendor.get_value_or("[none]"), this_disk.model.get_value_or("[none]")); - this_disk.mounted = static_cast<bool>(mount_point(description)); + this_disk.mounted = is_mounted(description); auto media_size_cstr = CFDictionaryGetValue (description, kDADiskDescriptionMediaSizeKey); if (!media_size_cstr) { |
