VirtualBox

Changeset 85266 in vbox


Ignore:
Timestamp:
Jul 12, 2020 1:04:10 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139243
Message:

Main/HostImpl.cpp: Some cleanups around NetIfCreateHostOnlyNetworkInterface. bugref:9790

File:
1 edited

Legend:

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

    r85260 r85266  
    419419        ComPtr<IProgress> progress;
    420420
    421         int r = NetIfCreateHostOnlyNetworkInterface(m->pParent,
    422                                                     hif.asOutParam(),
    423                                                     progress.asOutParam(),
    424                                                     it->c_str());
    425         if (RT_FAILURE(r))
    426             LogRel(("failed to create %s, error (0x%x)\n", it->c_str(), r));
     421        int vrc = NetIfCreateHostOnlyNetworkInterface(m->pParent,
     422                                                      hif.asOutParam(),
     423                                                      progress.asOutParam(),
     424                                                      it->c_str());
     425        if (RT_FAILURE(vrc))
     426            LogRel(("failed to create %s, error (%Rrc)\n", it->c_str(), vrc));
    427427    }
    428428
     
    714714            ComPtr<IProgress> progress;
    715715
    716             int rc = NetIfCreateHostOnlyNetworkInterface(m->pParent, hif.asOutParam(), progress.asOutParam(), pInfo->bstrName.raw());
    717             if (RT_FAILURE(rc))
     716            int vrc = NetIfCreateHostOnlyNetworkInterface(m->pParent, hif.asOutParam(), progress.asOutParam(),
     717                                                          pInfo->bstrName.raw());
     718            if (RT_FAILURE(vrc))
    718719            {
    719                 LogRel(("Failed to create host-only adapter (%d)\n", rc));
     720                LogRel(("Failed to create host-only adapter (%Rrc)\n", vrc));
    720721                hrc = E_UNEXPECTED;
    721722                break;
    722723            }
     724
    723725            /* Wait for the adapter to get configured completely, before we modify IP addresses. */
    724726            progress->WaitForCompletion(-1);
     
    14211423     * called below grabs the VirtualBox lock. */
    14221424
    1423     int r = NetIfCreateHostOnlyNetworkInterface(m->pParent, aHostInterface.asOutParam(), aProgress.asOutParam());
    1424     if (RT_SUCCESS(r))
     1425    int vrc = NetIfCreateHostOnlyNetworkInterface(m->pParent, aHostInterface.asOutParam(), aProgress.asOutParam());
     1426    if (RT_SUCCESS(vrc))
    14251427    {
    14261428        if (aHostInterface.isNull())
     
    14281430                            tr("Unable to create a host network interface"));
    14291431
    1430 #if !defined(RT_OS_WINDOWS)
     1432# if !defined(RT_OS_WINDOWS)
    14311433        Bstr tmpAddr, tmpMask, tmpName;
    14321434        HRESULT hrc;
     
    14531455                                               tmpMask.raw());
    14541456        ComAssertComRCRet(hrc, hrc);
    1455 #endif /* !defined(RT_OS_WINDOWS) */
     1457# endif /* !defined(RT_OS_WINDOWS) */
    14561458    }
    14571459
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