Changeset 98292 in vbox for trunk/src/VBox/Main/src-server/solaris
- Timestamp:
- Jan 25, 2023 1:14:53 AM (23 months ago)
- Location:
- trunk/src/VBox/Main/src-server/solaris
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/DynLoadLibSolaris.cpp
r98103 r98292 62 62 return g_hLibDlpi != NIL_RTLDRMOD; 63 63 g_fCheckedForLibDlpi = true; 64 int rc = RTLdrLoad(LIB_DLPI, &hLibDlpi);65 if (RT_SUCCESS( rc))64 int vrc = RTLdrLoad(LIB_DLPI, &hLibDlpi); 65 if (RT_SUCCESS(vrc)) 66 66 { 67 67 /* … … 69 69 * open the VNIC/link which requires root permissions :/ 70 70 */ 71 rc = RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk);72 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose);73 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen);74 if (RT_SUCCESS( rc))71 vrc = RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk); 72 vrc |= RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose); 73 vrc |= RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen); 74 if (RT_SUCCESS(vrc)) 75 75 { 76 76 g_hLibDlpi = hLibDlpi; -
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r98103 r98292 461 461 RT_ZERO(IfNum); 462 462 IfNum.lifn_family = AF_INET; 463 int rc = ioctl(Sock, SIOCGLIFNUM, &IfNum);464 if (! rc)463 int iRc = ioctl(Sock, SIOCGLIFNUM, &IfNum); 464 if (!iRc) 465 465 { 466 466 int cIfaces = RT_MIN(1024, IfNum.lifn_count); /* sane limit */ … … 474 474 IfConfig.lifc_len = (int)cbIfaces; 475 475 IfConfig.lifc_buf = (caddr_t)paIfaces; 476 rc = ioctl(Sock, SIOCGLIFCONF, &IfConfig);477 if (! rc)476 iRc = ioctl(Sock, SIOCGLIFCONF, &IfConfig); 477 if (!iRc) 478 478 { 479 479 for (int i = 0; i < cIfaces; i++) … … 486 486 487 487 #if 0 488 rc = ioctl(Sock, SIOCGLIFADDR, &(paIfaces[i]));489 if ( rc >= 0)488 iRc = ioctl(Sock, SIOCGLIFADDR, &(paIfaces[i])); 489 if (iRc >= 0) 490 490 { 491 491 memcpy(Info.IPAddress.au8, ((struct sockaddr *)&paIfaces[i].lifr_addr)->sa_data, … … 501 501 * address this way, so we just use all zeros there. 502 502 */ 503 rc = ioctl(Sock, SIOCGARP, &ArpReq);504 if ( rc >= 0)503 iRc = ioctl(Sock, SIOCGARP, &ArpReq); 504 if (iRc >= 0) 505 505 memcpy(&Info.MACAddress, ArpReq.arp_ha.sa_data, sizeof(Info.MACAddress)); 506 506 -
trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp
r98103 r98292 181 181 182 182 uint64_t cb; 183 int rc = RTSystemQueryTotalRam(&cb);184 if (RT_FAILURE( rc))183 int vrc = RTSystemQueryTotalRam(&cb); 184 if (RT_FAILURE(vrc)) 185 185 totalRAM = 0; 186 186 else … … 201 201 int CollectorSolaris::getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle) 202 202 { 203 int rc = VINF_SUCCESS;204 203 kstat_t *ksp; 205 204 uint64_t tmpUser, tmpKernel, tmpIdle; … … 237 236 if (idle) *idle = tmpIdle; 238 237 239 return rc;238 return VINF_SUCCESS; 240 239 } 241 240 242 241 int CollectorSolaris::getRawProcessCpuLoad(RTPROCESS process, uint64_t *user, uint64_t *kernel, uint64_t *total) 243 242 { 244 int rc = VINF_SUCCESS;243 int vrc = VINF_SUCCESS; 245 244 char *pszName; 246 245 prusage_t prusage; … … 275 274 { 276 275 Log(("read() -> %d\n", errno)); 277 rc = VERR_FILE_IO_ERROR;276 vrc = VERR_FILE_IO_ERROR; 278 277 } 279 278 close(h); … … 282 281 { 283 282 Log(("open() -> %d\n", errno)); 284 rc = VERR_ACCESS_DENIED;285 } 286 287 return rc;283 vrc = VERR_ACCESS_DENIED; 284 } 285 286 return vrc; 288 287 } 289 288 … … 292 291 AssertReturn(totalRAM, VERR_INTERNAL_ERROR); 293 292 uint64_t cb; 294 int rc = RTSystemQueryAvailableRam(&cb);295 if (RT_SUCCESS( rc))293 int vrc = RTSystemQueryAvailableRam(&cb); 294 if (RT_SUCCESS(vrc)) 296 295 { 297 296 *total = totalRAM; … … 299 298 *used = *total - *available; 300 299 } 301 return rc;300 return vrc; 302 301 } 303 302 304 303 int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 305 304 { 306 int rc = VINF_SUCCESS;305 int vrc = VINF_SUCCESS; 307 306 char *pszName = NULL; 308 307 psinfo_t psinfo; … … 327 326 { 328 327 Log(("read() -> %d\n", errno)); 329 rc = VERR_FILE_IO_ERROR;328 vrc = VERR_FILE_IO_ERROR; 330 329 } 331 330 close(h); … … 334 333 { 335 334 Log(("open() -> %d\n", errno)); 336 rc = VERR_ACCESS_DENIED;337 } 338 339 return rc;335 vrc = VERR_ACCESS_DENIED; 336 } 337 338 return vrc; 340 339 } 341 340 … … 471 470 int CollectorSolaris::getRawHostDiskLoad(const char *name, uint64_t *disk_ms, uint64_t *total_ms) 472 471 { 473 int rc = VINF_SUCCESS;472 int vrc = VINF_SUCCESS; 474 473 AssertReturn(strlen(name) < KSTAT_STRLEN, VERR_INVALID_PARAMETER); 475 474 LogFlowThisFunc(("n=%s\n", name)); … … 480 479 { 481 480 LogRel(("kstat_read(%s) -> %d\n", name, errno)); 482 rc = VERR_INTERNAL_ERROR;481 vrc = VERR_INTERNAL_ERROR; 483 482 } 484 483 else … … 496 495 { 497 496 LogRel(("kstat_lookup(%s) -> %d\n", name, errno)); 498 rc = VERR_INTERNAL_ERROR;499 } 500 501 return rc;497 vrc = VERR_INTERNAL_ERROR; 498 } 499 500 return vrc; 502 501 } 503 502 … … 568 567 int CollectorSolaris::getHostDiskSize(const char *name, uint64_t *size) 569 568 { 570 int rc = VINF_SUCCESS;569 int vrc = VINF_SUCCESS; 571 570 AssertReturn(strlen(name) + 5 < KSTAT_STRLEN, VERR_INVALID_PARAMETER); 572 571 LogFlowThisFunc(("n=%s\n", name)); … … 580 579 { 581 580 LogRel(("kstat_read(%s) -> %d\n", name, errno)); 582 rc = VERR_INTERNAL_ERROR;581 vrc = VERR_INTERNAL_ERROR; 583 582 } 584 583 else … … 596 595 { 597 596 LogRel(("kstat_lookup(%s) -> %d\n", szName, errno)); 598 rc = VERR_INTERNAL_ERROR;599 } 600 601 602 return rc;597 vrc = VERR_INTERNAL_ERROR; 598 } 599 600 601 return vrc; 603 602 } 604 603 … … 731 730 { 732 731 struct mnttab Entry; 733 int rc = 0;732 int iRc = 0; 734 733 resetmnttab(fp); 735 while (( rc = getmntent(fp, &Entry)) == 0)734 while ((iRc = getmntent(fp, &Entry)) == 0) 736 735 mFsMap[Entry.mnt_mountp] = Entry.mnt_special; 737 736 fclose(fp); 738 if ( rc != -1)739 LogRel(("Error while reading mnttab: %d\n", rc));740 } 741 } 742 743 } 737 if (iRc != -1) 738 LogRel(("Error while reading mnttab: %d\n", iRc)); 739 } 740 } 741 742 } -
trunk/src/VBox/Main/src-server/solaris/USBProxyBackendSolaris.cpp
r98103 r98292 91 91 * Create semaphore. 92 92 */ 93 int rc = RTSemEventCreate(&mNotifyEventSem);94 if (RT_FAILURE( rc))95 return rc;93 int vrc = RTSemEventCreate(&mNotifyEventSem); 94 if (RT_FAILURE(vrc)) 95 return vrc; 96 96 97 97 /* 98 98 * Initialize the USB library. 99 99 */ 100 rc = USBLibInit();101 if (RT_FAILURE( rc))100 vrc = USBLibInit(); 101 if (RT_FAILURE(vrc)) 102 102 { 103 103 /* mNotifyEventSem will be destroyed in uninit */ 104 return rc;104 return vrc; 105 105 } 106 106 … … 209 209 int *pInt = NULL; 210 210 char *pStr = NULL; 211 int rc = DI_WALK_CONTINUE;211 int iRc = DI_WALK_CONTINUE; 212 212 if (di_prop_lookup_ints(DDI_DEV_T_ANY, Node, "interface", &pInt) < 0) 213 213 { … … 337 337 pList->pTail = pList->pHead = pCur; 338 338 339 rc = DI_WALK_CONTINUE;339 iRc = DI_WALK_CONTINUE; 340 340 } while (0); 341 341 … … 344 344 solarisFreeUSBDevice(pCur); 345 345 } 346 return rc;346 return iRc; 347 347 } 348 348 … … 393 393 394 394 PUSBDEVICE pDev = aDevice->i_getUsbData(); 395 int rc = USBLibResetDevice(pDev->pszDevicePath, true);396 if (RT_SUCCESS( rc))395 int vrc = USBLibResetDevice(pDev->pszDevicePath, true); 396 if (RT_SUCCESS(vrc)) 397 397 aDevice->i_setBackendUserData(pvId); 398 398 else … … 401 401 pvId = NULL; 402 402 } 403 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId));404 return rc;403 LogFlowThisFunc(("returns %Rrc pvId=%p\n", vrc, pvId)); 404 return vrc; 405 405 } 406 406 … … 449 449 450 450 PUSBDEVICE pDev = aDevice->i_getUsbData(); 451 int rc = USBLibResetDevice(pDev->pszDevicePath, true /* Re-attach */);452 if (RT_SUCCESS( rc))451 int vrc = USBLibResetDevice(pDev->pszDevicePath, true /* Re-attach */); 452 if (RT_SUCCESS(vrc)) 453 453 aDevice->i_setBackendUserData(pvId); 454 454 else … … 457 457 pvId = NULL; 458 458 } 459 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId));460 return rc;459 LogFlowThisFunc(("returns %Rrc pvId=%p\n", vrc, pvId)); 460 return vrc; 461 461 } 462 462
Note:
See TracChangeset
for help on using the changeset viewer.