VirtualBox

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


Ignore:
Timestamp:
Mar 1, 2013 11:21:06 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84051
Message:

VBoxManageGuestCtrl: Print plain PID on non-verbose runs to support script handling.

File:
1 edited

Legend:

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

    r44883 r44885  
    806806            case ProcessWaitResult_Start:
    807807            {
     808                ULONG uPID = 0;
     809                rc = pProcess->COMGETTER(PID)(&uPID);
     810                if (FAILED(rc))
     811                {
     812                    ctrlPrintError(pProcess, COM_IIDOF(IProcess));
     813
     814                    pGuestSession->Close();
     815                    return RTEXITCODE_FAILURE;
     816                }
     817
    808818                if (fVerbose)
    809819                {
    810                     ULONG uPID = 0;
    811                     rc = pProcess->COMGETTER(PID)(&uPID);
    812                     if (FAILED(rc))
    813                     {
    814                         ctrlPrintError(pProcess, COM_IIDOF(IProcess));
    815 
    816                         pGuestSession->Close();
    817                         return RTEXITCODE_FAILURE;
    818                     }
    819 
    820                     RTPrintf("Process '%s' (PID: %u) %s\n",
     820                    RTPrintf("Process '%s' (PID: %ul) %s\n",
    821821                             strCmd.c_str(), uPID,
    822822                             fWaitForExit ? "started" : "started (detached)");
    823 
    824                     /* We're done here if we don't want to wait for termination. */
    825                     if (!fWaitForExit)
    826                         fCompleted = true;
    827823                }
     824                else
     825                {
     826                    /* Just print plain PID to make it easier for scripts
     827                     * invoking VBoxManage. */
     828                    RTPrintf("%ul\n", uPID);
     829                }
     830
     831                /* We're done here if we don't want to wait for termination. */
     832                if (!fWaitForExit)
     833                    fCompleted = true;
     834
    828835                break;
    829836            }
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