From 8d43d5f911db4e92adff7f0951edecde66aa9354 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 3 Apr 2020 22:59:33 +0200 Subject: [PATCH] Remove debug code; fix media path key reading. --- src/lib/cross_osx.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 254ee6eac..a95854015 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -36,6 +36,7 @@ extern "C" { #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ extern "C" { #include #include #include +#include #include "i18n.h" @@ -91,7 +93,6 @@ cpu_info () boost::filesystem::path app_contents () { - std::cout << "program_location=" << boost::dll::program_location() << "\n"; return boost::dll::program_location().parent_path().parent_path(); } @@ -266,7 +267,8 @@ disk_appeared (DADiskRef disk, void* context) str = CFDictionaryGetValue (description, kDADiskDescriptionMediaPathKey); if (str) { - if (strncmp(str, "IoDeviceTree:", 13) != 0) { + char const* path = CFStringGetCStringPtr((CFStringRef) str, kCFStringEncodingUTF8); + if (strncmp(path, "IODeviceTree:", 13) != 0) { return; } } @@ -275,7 +277,7 @@ disk_appeared (DADiskRef disk, void* context) CFTypeRef whole_media_ref = IORegistryEntryCreateCFProperty (service, CFSTR(kIOMediaWholeKey), kCFAllocatorDefault, 0); bool whole_media = false; if (whole_media_ref) { - whole_media = CFBooleanGetValue((CFBooleanRef) whole_media); + whole_media = CFBooleanGetValue((CFBooleanRef) whole_media_ref); CFRelease (whole_media_ref); } IOObjectRelease (service); @@ -294,7 +296,6 @@ disk_appeared (DADiskRef disk, void* context) vector get_drives () { -std::cout << "get_drives!\n"; vector drives; DASessionRef session = DASessionCreate(kCFAllocatorDefault); -- 2.30.2