VirtualBox

Ignore:
Timestamp:
May 31, 2022 9:11:39 AM (3 years ago)
Author:
vboxsync
Message:

Frontends + Main: Adjust to the new rules wrt. to rc -> hrc,vrc usage. This also fixes quite a few bugs wrt shadow variables, wrong return values and output error translations / exit codes. Also see @todos added. ​​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp

    r94236 r95140  
    218218RTEXITCODE handleImportAppliance(HandlerArg *arg)
    219219{
    220     HRESULT rc = S_OK;
     220    HRESULT hrc = S_OK;
    221221    APPLIANCETYPE enmApplType = NOT_SET;
    222222    Utf8Str strOvfFilename;
     
    497497        RTStrFree(pszAbsFilePath);
    498498
    499         rc = showProgress(progressRead);
     499        hrc = showProgress(progressRead);
    500500        CHECK_PROGRESS_ERROR_RET(progressRead, (Appliance::tr("Appliance read failed")), RTEXITCODE_FAILURE);
    501501
     
    511511            // to tinker with the error info a bit
    512512            RTStrmPrintf(g_pStdErr, Appliance::tr("Interpreting %ls...\n"), path.raw());
    513             rc = pAppliance->Interpret();
     513            hrc = pAppliance->Interpret();
    514514            com::ErrorInfoKeeper eik;
    515515
     
    528528
    529529            eik.restore();
    530             if (FAILED(rc))     // during interpret, after printing warnings
     530            if (FAILED(hrc))     // during interpret, after printing warnings
    531531            {
    532                 com::GlueHandleComError(pAppliance, "Interpret()", rc, __FILE__, __LINE__);
     532                com::GlueHandleComError(pAppliance, "Interpret()", hrc, __FILE__, __LINE__);
    533533                break;
    534534            }
     
    13941394                                  ImportMachines(ComSafeArrayAsInParam(options), progress.asOutParam()));
    13951395
    1396                 rc = showProgress(progress);
     1396                hrc = showProgress(progress);
    13971397                CHECK_PROGRESS_ERROR_RET(progress, (Appliance::tr("Appliance import failed")), RTEXITCODE_FAILURE);
    13981398
    1399                 if (SUCCEEDED(rc))
     1399                if (SUCCEEDED(hrc))
    14001400                    RTPrintf(Appliance::tr("Successfully imported the appliance.\n"));
    14011401            }
     
    14031403    } while (0);
    14041404
    1405     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     1405    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    14061406}
    14071407
     
    14851485RTEXITCODE handleExportAppliance(HandlerArg *a)
    14861486{
    1487     HRESULT rc = S_OK;
     1487    HRESULT hrc = S_OK;
    14881488
    14891489    Utf8Str strOutputFile;
     
    17611761            }
    17621762
    1763             if (FAILED(rc))
     1763            if (FAILED(hrc))
    17641764                break;
    17651765        }
    17661766
    1767         if (FAILED(rc))
     1767        if (FAILED(hrc))
    17681768            break;
    17691769
     
    19281928        }
    19291929
    1930         if (FAILED(rc))
     1930        if (FAILED(hrc))
    19311931            break;
    19321932
     
    19751975        RTStrFree(pszAbsFilePath);
    19761976
    1977         rc = showProgress(progress);
     1977        hrc = showProgress(progress);
    19781978        CHECK_PROGRESS_ERROR_RET(progress, (Appliance::tr("Appliance write failed")), RTEXITCODE_FAILURE);
    19791979
    1980         if (SUCCEEDED(rc))
     1980        if (SUCCEEDED(hrc))
    19811981            RTPrintf(Appliance::tr("Successfully exported %d machine(s).\n", "", llMachines.size()), llMachines.size());
    19821982
     
    20392039                    ComPtr<IProgress> progress1;
    20402040                    CHECK_ERROR_BREAK(oCloudClient, LaunchVM(pVSD, progress1.asOutParam()));
    2041                     rc = showProgress(progress1);
     2041                    hrc = showProgress(progress1);
    20422042                    CHECK_PROGRESS_ERROR_RET(progress1, (Appliance::tr("Creating the cloud instance failed")),
    20432043                                             RTEXITCODE_FAILURE);
    20442044
    2045                     if (SUCCEEDED(rc))
     2045                    if (SUCCEEDED(hrc))
    20462046                    {
    20472047                        CHECK_ERROR_BREAK(pVSD, GetDescriptionByType(VirtualSystemDescriptionType_CloudInstanceId,
     
    20622062    } while (0);
    20632063
    2064     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     2064    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    20652065}
    20662066
Note: See TracChangeset for help on using the changeset viewer.

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