Changeset 5701 in vbox for trunk/src/VBox/Devices/Network/DrvTAP.cpp
- Timestamp:
- Nov 12, 2007 10:32:04 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r5698 r5701 170 170 171 171 /******************************************************************************* 172 * Internal Functions & Globals*172 * Internal Functions * 173 173 *******************************************************************************/ 174 174 #ifdef RT_OS_SOLARIS … … 325 325 size_t cbRead = 0; 326 326 #ifdef VBOX_WITH_CROSSBOW 327 rc = VINF_SUCCESS;328 327 cbRead = sizeof(achBuf); 329 int rc2 = dlpi_recv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL); 330 if (rc2 != DLPI_SUCCESS) 331 rc = SolarisDLPIErr2VBoxErr(rc2); 328 rc = dlpi_recv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL); 329 rc = RT_LIKELY(rc == DLPI_SUCCESS) ? VINF_SUCCESS : SolarisDLPIErr2VBoxErr(rc); 332 330 #else 333 331 rc = RTFileRead(pData->FileDevice, achBuf, sizeof(achBuf), &cbRead); … … 465 463 size_t cbRead = 0; 466 464 #ifdef VBOX_WITH_CROSSBOW 467 int rc = VINF_SUCCESS;468 465 cbRead = sizeof(achBuf); 469 int rc2 = dlpi_recv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL); 470 if (rc2 != DLPI_SUCCESS) 471 rc = SolarisDLPIErr2VBoxErr(rc2); 466 int rc = dlpi_recv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL); 467 rc = RT_LIKELY(rc == DLPI_SUCCESS) ? VINF_SUCCESS : SolarisDLPIErr2VBoxErr(rc); 472 468 #else 473 469 int rc = RTFileRead(pData->FileDevice, achBuf, RT_MIN(sizeof(achBuf), cbMax), &cbRead); … … 527 523 if (RT_SUCCESS(rc)) 528 524 { 529 if (Status.iStatus == 0 && Status.enmReason == RTPROCEXITREASON_NORMAL) 525 if ( Status.iStatus == 0 526 && Status.enmReason == RTPROCEXITREASON_NORMAL) 530 527 return VINF_SUCCESS; 531 528 532 529 LogRel(("TAP#%d: Error running TAP setup application: %s\n", pData->pDrvIns->iInstance, pData->pszSetupApplication)); 533 return VERR_HOSTIF_INIT_FAILED;534 530 } 535 531 else 536 {537 532 LogRel(("TAP#%d: RTProcWait failed for: %s\n", pData->pDrvIns->iInstance, pData->pszSetupApplication)); 538 return VERR_HOSTIF_INIT_FAILED;539 }540 533 } 541 534 else … … 545 538 pData->pszSetupApplication, strerror(errno))); 546 539 } 547 548 return VERR_HOSTIF_INIT_FAILED; 540 541 return VERR_HOSTIF_INIT_FAILED; 549 542 } 550 543 … … 572 565 if (RT_SUCCESS(rc)) 573 566 { 574 if (Status.iStatus == 0 && Status.enmReason == RTPROCEXITREASON_NORMAL) 567 if ( Status.iStatus == 0 568 && Status.enmReason == RTPROCEXITREASON_NORMAL) 575 569 return VINF_SUCCESS; 576 570 577 571 LogRel(("TAP#%d: Error running TAP terminate application: %s\n", pData->pDrvIns->iInstance, pData->pszTerminateApplication)); 578 return VERR_HOSTIF_TERM_FAILED;579 572 } 580 573 else 581 {582 574 LogRel(("TAP#%d: RTProcWait failed for: %s\n", pData->pDrvIns->iInstance, pData->pszTerminateApplication)); 583 return VERR_HOSTIF_INIT_FAILED;584 }585 575 } 586 576 else … … 590 580 pData->pszTerminateApplication, strerror(errno))); 591 581 } 592 return VERR_HOSTIF_TERM_FAILED; 582 return VERR_HOSTIF_TERM_FAILED; 593 583 } 594 584 … … 659 649 return PDMDrvHlpVMSetError(pData->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, 660 650 N_("dladm_vnic_create() failed. NIC %s probably incorrect."), szNICName); 661 651 662 652 pData->pszDeviceNameActual = NULL; 663 653 RTStrAPrintf(&pData->pszDeviceNameActual, "vnic%u", VnicID); … … 742 732 rc = VERR_HOSTIF_INIT_FAILED; 743 733 } 744 free(pBuf);734 RTMemFree(pBuf); 745 735 } 746 736 else … … 855 845 case DLPI_EINHANDLE: return VERR_INVALID_HANDLE; 856 846 case DLPI_ETIMEDOUT: return VERR_TIMEOUT; 857 case DLPI_FAILURE: return VERR_GENERAL_FAILURE; 847 case DLPI_FAILURE: return VERR_GENERAL_FAILURE; 858 848 859 849 case DLPI_EVERNOTSUP: … … 871 861 } 872 862 873 AssertMsgFailed(("SolarisDLPIErr2VBoxErr: Unhandled error %d\n", rc)); 863 AssertMsgFailed(("SolarisDLPIErr2VBoxErr: Unhandled error %d\n", rc)); 874 864 return VERR_UNRESOLVED_ERROR; 875 865 } … … 1119 1109 1120 1110 #ifdef RT_OS_SOLARIS 1111 /** @todo r=bird: This *does* need checking against ConsoleImpl2.cpp if used on non-solaris systems. */ 1121 1112 if (pData->FileDevice != NIL_RTFILE) 1122 1113 {
Note:
See TracChangeset
for help on using the changeset viewer.