VirtualBox

Ignore:
Timestamp:
Jan 24, 2023 3:32:43 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155493
Message:

Main/src-server: rc -> hrc/vrc (partial). bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp

    r98103 r98288  
    126126{
    127127    LogFlowThisFunc(("entered\n"));
    128     int rc;
     128    int vrc;
    129129    try
    130130    {
     
    133133         * environment variable. */
    134134        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);
    138138    }
    139139    catch (std::bad_alloc &)
    140140    {
    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;
    145145}
    146146
     
    148148{
    149149    LogFlowThisFunc(("entered\n"));
    150     int rc;
     150    int vrc;
    151151    try
    152152    {
     
    154154        mFloppyList.clear();
    155155        bool fSuccess = false;  /* ignored */
    156         rc = getDriveInfoFromEnv("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, &fSuccess);
     156        vrc = getDriveInfoFromEnv("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, &fSuccess);
    157157    }
    158158    catch (std::bad_alloc &)
    159159    {
    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;
    164164}
    165165
     
    167167{
    168168    LogFlowThisFunc(("entered\n"));
    169     int rc;
     169    int vrc;
    170170    try
    171171    {
    172172        mFixedDriveList.clear();
    173173        bool fSuccess = false;  /* ignored */
    174         rc = getDriveInfoFromCAM(&mFixedDriveList, Fixed, &fSuccess);
     174        vrc = getDriveInfoFromCAM(&mFixedDriveList, Fixed, &fSuccess);
    175175    }
    176176    catch (std::bad_alloc &)
    177177    {
    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;
    182182}
    183183
     
    324324{
    325325    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))
    328328    {
    329329        union ccb DeviceCCB;
     
    377377            do
    378378            {
    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))
    381381                {
    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));
    383383                    break;
    384384                }
     
    431431                        do
    432432                        {
    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))
    435435                            {
    436                                 Log(("Error while querying available periph devices rc=%Rrc\n", rc));
     436                                Log(("Error while querying available periph devices vrc=%Rrc\n", vrc));
    437437                                break;
    438438                            }
     
    479479                            {
    480480                                pList->clear();
    481                                 rc = VERR_NO_MEMORY;
     481                                vrc = VERR_NO_MEMORY;
    482482                                break;
    483483                            }
     
    489489            } while (   DeviceCCB.ccb_h.status == CAM_REQ_CMP
    490490                     && DeviceCCB.cdm.status == CAM_DEV_MATCH_MORE
    491                      && RT_SUCCESS(rc));
     491                     && RT_SUCCESS(vrc));
    492492
    493493            RTMemFree(paMatches);
    494494        }
    495495        else
    496             rc = VERR_NO_MEMORY;
     496            vrc = VERR_NO_MEMORY;
    497497
    498498        RTFileClose(hFileXpt);
    499499    }
    500500
    501     return rc;
     501    return vrc;
    502502}
    503503
     
    524524    AssertPtrNullReturn(pfSuccess, VERR_INVALID_POINTER);
    525525    LogFlowFunc(("pcszVar=%s, pList=%p, isDVD=%d, pfSuccess=%p\n", pcszVar, pList, isDVD, pfSuccess));
    526     int rc = VINF_SUCCESS;
     526    int vrc = VINF_SUCCESS;
    527527    bool success = false;
    528528    char *pszFreeMe = RTEnvDupEx(RTENV_DEFAULT, pcszVar);
     
    552552    catch (std::bad_alloc &)
    553553    {
    554         rc = VERR_NO_MEMORY;
     554        vrc = VERR_NO_MEMORY;
    555555    }
    556556    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.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette