diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 738e39658fe..c894471ad63 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2977,7 +2977,8 @@ QByteArray QSysInfo::machineUniqueId() { #if defined(Q_OS_DARWIN) && __has_include() char uuid[UuidStringLen + 1]; - io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); + static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault + io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); return QByteArray(uuid);