VirtualBox

Changeset 83259 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 11, 2020 3:18:52 PM (5 years ago)
Author:
vboxsync
Message:

FE/VBoxMange / Guest Control: Explicitly use the bit bucket if waiting for in-/output is not wanted, to provide a valid VFS handle when needed. bugref:9135

File:
1 edited

Legend:

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

    r82968 r83259  
    11471147 * @return  IPRT status code.
    11481148 * @param   pProcess        Pointer to appropriate process object.
    1149  * @param   hVfsIosDst      Where to write the data.
     1149 * @param   hVfsIosDst      Where to write the data. Can be the bit bucket or a (valid [std]) handle.
    11501150 * @param   uHandle         Handle where to read the data from.
    11511151 * @param   cMsTimeout      Timeout (in ms) to wait for the operation to
     
    11861186 *
    11871187 * @returns true if enabled and we successfully configured it.
    1188  * @param   fEnabled            Whether pumping this pipe is configured.
     1188 * @param   fEnabled            Whether pumping this pipe is configured to std handles,
     1189 *                              or going to the bit bucket instead.
    11891190 * @param   enmHandle           The IPRT standard handle designation.
    11901191 * @param   pszName             The name for user messages.
     
    12091210        RTMsgWarning("Error getting %s handle: %Rrc", pszName, vrc);
    12101211    }
     1212    else /* If disabled, all goes to / gets fed to/from the bit bucket. */
     1213    {
     1214        RTFILE hFile;
     1215        int vrc = RTFileOpenBitBucket(&hFile, enmHandle == RTHANDLESTD_INPUT ? RTFILE_O_READ : RTFILE_O_WRITE);
     1216        if (RT_SUCCESS(vrc))
     1217        {
     1218            vrc = RTVfsIoStrmFromRTFile(hFile, 0 /* fOpen */, false /* fLeaveOpen */, phVfsIos);
     1219            if (RT_SUCCESS(vrc))
     1220                return true;
     1221        }
     1222    }
     1223
    12111224    return false;
    12121225}
     
    15241537                        RTThreadYield();
    15251538                        fReadStdOut = fReadStdErr = true;
     1539                        /* Note: In case the user specified explicitly not wanting to wait for stdout / stderr,
     1540                         * the configured VFS handle goes to / will be fed from the bit bucket. */
    15261541                        break;
    15271542                    case ProcessWaitResult_Timeout:
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