Changeset 98287 in vbox for trunk/src/VBox/Main/src-server/darwin/iokit.cpp
- Timestamp:
- Jan 24, 2023 1:40:47 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155492
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/darwin/iokit.cpp
r98103 r98287 126 126 /* Get the darwin version we are running on. */ 127 127 char szVersion[64]; 128 int rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, &szVersion[0], sizeof(szVersion));129 if (RT_SUCCESS( rc))130 { 131 rc = RTStrToUInt32Ex(&szVersion[0], NULL, 10, &g_uMajorDarwin);132 AssertLogRelMsg( rc == VINF_SUCCESS ||rc == VWRN_TRAILING_CHARS,128 int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, &szVersion[0], sizeof(szVersion)); 129 if (RT_SUCCESS(vrc)) 130 { 131 vrc = RTStrToUInt32Ex(&szVersion[0], NULL, 10, &g_uMajorDarwin); 132 AssertLogRelMsg(vrc == VINF_SUCCESS || vrc == VWRN_TRAILING_CHARS, 133 133 ("Failed to convert the major part of the version string '%s' into an integer: %Rrc\n", 134 szVersion, rc));134 szVersion, vrc)); 135 135 } 136 136 else 137 AssertLogRelMsgFailed(("Failed to query the OS release version with %Rrc\n", rc));137 AssertLogRelMsgFailed(("Failed to query the OS release version with %Rrc\n", vrc)); 138 138 } 139 139 return true; … … 659 659 * Create the notification callbacks. 660 660 */ 661 kern_return_t rc = IOServiceAddMatchingNotification(pNotify->NotifyPort,662 kIOPublishNotification,663 IOServiceMatching(kIOUSBDeviceClassName),664 darwinUSBAttachNotification1,665 pNotify,666 &pNotify->AttachIterator);667 if ( rc == KERN_SUCCESS)661 kern_return_t krc = IOServiceAddMatchingNotification(pNotify->NotifyPort, 662 kIOPublishNotification, 663 IOServiceMatching(kIOUSBDeviceClassName), 664 darwinUSBAttachNotification1, 665 pNotify, 666 &pNotify->AttachIterator); 667 if (krc == KERN_SUCCESS) 668 668 { 669 669 darwinDrainIterator(pNotify->AttachIterator); 670 rc = IOServiceAddMatchingNotification(pNotify->NotifyPort,671 kIOMatchedNotification,672 IOServiceMatching(kIOUSBDeviceClassName),673 darwinUSBAttachNotification2,674 pNotify,675 &pNotify->AttachIterator2);676 if ( rc == KERN_SUCCESS)670 krc = IOServiceAddMatchingNotification(pNotify->NotifyPort, 671 kIOMatchedNotification, 672 IOServiceMatching(kIOUSBDeviceClassName), 673 darwinUSBAttachNotification2, 674 pNotify, 675 &pNotify->AttachIterator2); 676 if (krc == KERN_SUCCESS) 677 677 { 678 678 darwinDrainIterator(pNotify->AttachIterator2); 679 rc = IOServiceAddMatchingNotification(pNotify->NotifyPort, 680 kIOTerminatedNotification, 681 IOServiceMatching(kIOUSBDeviceClassName), 682 darwinUSBDetachNotification, 683 pNotify, 684 &pNotify->DetachIterator); 679 krc = IOServiceAddMatchingNotification(pNotify->NotifyPort, 680 kIOTerminatedNotification, 681 IOServiceMatching(kIOUSBDeviceClassName), 682 darwinUSBDetachNotification, 683 pNotify, 684 &pNotify->DetachIterator); 685 if (krc == KERN_SUCCESS) 685 686 { 686 687 darwinDrainIterator(pNotify->DetachIterator);
Note:
See TracChangeset
for help on using the changeset viewer.