Changeset 98288 in vbox for trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
- Timestamp:
- Jan 24, 2023 3:32:43 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155493
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
r98103 r98288 126 126 { 127 127 LogFlowThisFunc(("entered\n")); 128 int rc;128 int vrc; 129 129 try 130 130 { … … 133 133 * environment variable. */ 134 134 bool fSuccess = false; /* Have we succeeded in finding anything yet? */ 135 rc = getDriveInfoFromEnv("VBOX_CDROM", &mDVDList, true /* isDVD */, &fSuccess);136 if (RT_SUCCESS( rc) && !fSuccess)137 rc = getDriveInfoFromCAM(&mDVDList, DVD, &fSuccess);135 vrc = getDriveInfoFromEnv("VBOX_CDROM", &mDVDList, true /* isDVD */, &fSuccess); 136 if (RT_SUCCESS(vrc) && !fSuccess) 137 vrc = getDriveInfoFromCAM(&mDVDList, DVD, &fSuccess); 138 138 } 139 139 catch (std::bad_alloc &) 140 140 { 141 rc = VERR_NO_MEMORY;142 } 143 LogFlowThisFunc((" rc=%Rrc\n",rc));144 return rc;141 vrc = VERR_NO_MEMORY; 142 } 143 LogFlowThisFunc(("vrc=%Rrc\n", vrc)); 144 return vrc; 145 145 } 146 146 … … 148 148 { 149 149 LogFlowThisFunc(("entered\n")); 150 int rc;150 int vrc; 151 151 try 152 152 { … … 154 154 mFloppyList.clear(); 155 155 bool fSuccess = false; /* ignored */ 156 rc = getDriveInfoFromEnv("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, &fSuccess);156 vrc = getDriveInfoFromEnv("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, &fSuccess); 157 157 } 158 158 catch (std::bad_alloc &) 159 159 { 160 rc = VERR_NO_MEMORY;161 } 162 LogFlowThisFunc((" rc=%Rrc\n",rc));163 return rc;160 vrc = VERR_NO_MEMORY; 161 } 162 LogFlowThisFunc(("vrc=%Rrc\n", vrc)); 163 return vrc; 164 164 } 165 165 … … 167 167 { 168 168 LogFlowThisFunc(("entered\n")); 169 int rc;169 int vrc; 170 170 try 171 171 { 172 172 mFixedDriveList.clear(); 173 173 bool fSuccess = false; /* ignored */ 174 rc = getDriveInfoFromCAM(&mFixedDriveList, Fixed, &fSuccess);174 vrc = getDriveInfoFromCAM(&mFixedDriveList, Fixed, &fSuccess); 175 175 } 176 176 catch (std::bad_alloc &) 177 177 { 178 rc = VERR_NO_MEMORY;179 } 180 LogFlowThisFunc((" rc=%Rrc\n",rc));181 return rc;178 vrc = VERR_NO_MEMORY; 179 } 180 LogFlowThisFunc(("vrc=%Rrc\n", vrc)); 181 return vrc; 182 182 } 183 183 … … 324 324 { 325 325 RTFILE hFileXpt = NIL_RTFILE; 326 int rc = RTFileOpen(&hFileXpt, "/dev/xpt0", RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);327 if (RT_SUCCESS( rc))326 int vrc = RTFileOpen(&hFileXpt, "/dev/xpt0", RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 327 if (RT_SUCCESS(vrc)) 328 328 { 329 329 union ccb DeviceCCB; … … 377 377 do 378 378 { 379 rc = RTFileIoCtl(hFileXpt, CAMIOCOMMAND, &DeviceCCB, sizeof(union ccb), NULL);380 if (RT_FAILURE( rc))379 vrc = RTFileIoCtl(hFileXpt, CAMIOCOMMAND, &DeviceCCB, sizeof(union ccb), NULL); 380 if (RT_FAILURE(vrc)) 381 381 { 382 Log(("Error while querying available CD/DVD devices rc=%Rrc\n",rc));382 Log(("Error while querying available CD/DVD devices vrc=%Rrc\n", vrc)); 383 383 break; 384 384 } … … 431 431 do 432 432 { 433 rc = RTFileIoCtl(hFileXpt, CAMIOCOMMAND, &PeriphCCB, sizeof(union ccb), NULL);434 if (RT_FAILURE( rc))433 vrc = RTFileIoCtl(hFileXpt, CAMIOCOMMAND, &PeriphCCB, sizeof(union ccb), NULL); 434 if (RT_FAILURE(vrc)) 435 435 { 436 Log(("Error while querying available periph devices rc=%Rrc\n",rc));436 Log(("Error while querying available periph devices vrc=%Rrc\n", vrc)); 437 437 break; 438 438 } … … 479 479 { 480 480 pList->clear(); 481 rc = VERR_NO_MEMORY;481 vrc = VERR_NO_MEMORY; 482 482 break; 483 483 } … … 489 489 } while ( DeviceCCB.ccb_h.status == CAM_REQ_CMP 490 490 && DeviceCCB.cdm.status == CAM_DEV_MATCH_MORE 491 && RT_SUCCESS( rc));491 && RT_SUCCESS(vrc)); 492 492 493 493 RTMemFree(paMatches); 494 494 } 495 495 else 496 rc = VERR_NO_MEMORY;496 vrc = VERR_NO_MEMORY; 497 497 498 498 RTFileClose(hFileXpt); 499 499 } 500 500 501 return rc;501 return vrc; 502 502 } 503 503 … … 524 524 AssertPtrNullReturn(pfSuccess, VERR_INVALID_POINTER); 525 525 LogFlowFunc(("pcszVar=%s, pList=%p, isDVD=%d, pfSuccess=%p\n", pcszVar, pList, isDVD, pfSuccess)); 526 int rc = VINF_SUCCESS;526 int vrc = VINF_SUCCESS; 527 527 bool success = false; 528 528 char *pszFreeMe = RTEnvDupEx(RTENV_DEFAULT, pcszVar); … … 552 552 catch (std::bad_alloc &) 553 553 { 554 rc = VERR_NO_MEMORY;554 vrc = VERR_NO_MEMORY; 555 555 } 556 556 RTStrFree(pszFreeMe); 557 LogFlowFunc((" rc=%Rrc, success=%d\n",rc, success));558 return rc;559 } 560 557 LogFlowFunc(("vrc=%Rrc, success=%d\n", vrc, success)); 558 return vrc; 559 } 560
Note:
See TracChangeset
for help on using the changeset viewer.