VirtualBox

Changeset 90743 in vbox


Ignore:
Timestamp:
Aug 19, 2021 12:59:03 PM (3 years ago)
Author:
vboxsync
Message:

VBoxNetAdpCtl: when we check return value from execute() make it
explicit what we check for to improve readability. bugref:8093.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp

    r90742 r90743  
    238238        {
    239239            const char *pcszFamily = isAddrV6(pcszAddress) ? "inet6" : "inet";
    240             if (execute(CmdList(pcszAdapter) << pcszFamily))
    241                 execute(CmdList(pcszAdapter) << pcszFamily << "plumb" << "up");
     240            int status;
     241
     242            status = execute(CmdList(pcszAdapter) << pcszFamily);
     243            if (status != EXIT_SUCCESS)
     244                status = execute(CmdList(pcszAdapter) << pcszFamily << "plumb" << "up");
     245            if (status != EXIT_SUCCESS)
     246                return status;
     247
    242248            return CmdIfconfig::set(pcszAdapter, pcszAddress, pcszNetmask);
    243249        };
     
    247253        {
    248254            int rc = CmdIfconfig::removeV4(pcszAdapter, pcszAddress);
     255
     256            /** @todo Do we really need to unplumb inet here? */
    249257            execute(CmdList(pcszAdapter) << "inet" << "unplumb");
    250258            return rc;
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