VirtualBox

Changeset 40437 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Mar 13, 2012 8:56:13 AM (13 years ago)
Author:
vboxsync
Message:

GuestCtrl: Fixed return values for draining the execution stream, remove PID from table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r40403 r40437  
    10171017 * @return  IPRT status code.
    10181018 * @param   u32PID                  PID of process to get status for.
    1019  * @param   pProcess                Where to store the process information.
     1019 * @param   pProcess                Where to store the process information. Optional.
    10201020 * @param   fRemove                 Flag indicating whether to remove the
    10211021 *                                  process from the map when process marked a
     
    13811381        else /* No more output and/or error! */
    13821382        {
    1383             if (rc == VERR_NOT_FOUND)
     1383            if (   rc == VERR_NOT_FOUND
     1384                || rc == VERR_BROKEN_PIPE)
     1385            {
    13841386                rc = VINF_SUCCESS;
     1387            }
     1388
     1389            /* In any case remove the (terminated/broken) process from
     1390             * the process table. */
     1391            int rc2 = processGetStatus(aPID, NULL /* PVBOXGUESTCTRL_PROCESS */,
     1392                                       true /* Remove from table */);
     1393            AssertRC(rc2);
    13851394            break;
    13861395        }
     
    20942103                          Guest::tr("Guest process (PID %u) does not exist"), aPID);
    20952104        }
    2096         else
     2105        else if (proc.mStatus != ExecuteProcessStatus_Started)
     2106        {
     2107            /* If the process is still in the process table but does not run anymore
     2108             * don't remove it but report back an appropriate error. */
     2109            vrc = VERR_BROKEN_PIPE;
     2110            rc = setError(VBOX_E_IPRT_ERROR,
     2111                          Guest::tr("Guest process (PID %u) does not run anymore"), aPID);
     2112        }
     2113
     2114        if (RT_SUCCESS(vrc))
    20972115        {
    20982116            uint32_t uContextID = 0;
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