VirtualBox

Ignore:
Timestamp:
Nov 25, 2011 10:11:06 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75045
Message:

GuestCtrl: Added support for explicitly waiting on stdout/stderr, bugfixes, logging adjustments.

File:
1 edited

Legend:

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

    r38627 r39418  
    135135         */
    136136        ULONG uPID;
     137        GuestCtrlStreamObjects stdOut;
    137138        hr = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_STAT).raw(), Bstr("Querying file information").raw(),
    138139                                   ComSafeArrayAsInParam(args),
    139140                                   ComSafeArrayAsInParam(env),
    140141                                   aUsername, aPassword,
     142                                   ExecuteProcessFlag_WaitForStdOut,
     143                                   &stdOut, NULL,
    141144                                   NULL /* Progress */, &uPID);
    142145        if (SUCCEEDED(hr))
    143146        {
    144             GuestCtrlStreamObjects streamObjs;
    145             hr = executeStreamParse(uPID, streamObjs);
    146             if (SUCCEEDED(hr))
     147            int rc = VINF_SUCCESS;
     148            const char *pszFsType = stdOut[0].GetString("ftype");
     149            if (!pszFsType) /* Attribute missing? */
     150                rc = VERR_NOT_FOUND;
     151            if (   RT_SUCCESS(rc)
     152                && strcmp(pszFsType, "-")) /* Regular file? */
    147153            {
    148                 int rc = VINF_SUCCESS;
    149                 const char *pszFsType = streamObjs[0].GetString("ftype");
    150                 if (!pszFsType) /* Attribute missing? */
    151                      rc = VERR_NOT_FOUND;
    152                 if (   RT_SUCCESS(rc)
    153                     && strcmp(pszFsType, "-")) /* Regular file? */
    154                 {
    155                      rc = VERR_FILE_NOT_FOUND;
    156                      /* This is not critical for Main, so don't set hr --
    157                       * we will take care of rc then. */
    158                 }
    159                 if (   RT_SUCCESS(rc)
    160                     && aObjInfo) /* Do we want object details? */
    161                 {
    162                     hr = executeStreamQueryFsObjInfo(aFile, streamObjs[0],
    163                                                      aObjInfo, enmAddAttribs);
    164                 }
    165 
    166                 if (pRC)
    167                     *pRC = rc;
     154                rc = VERR_FILE_NOT_FOUND;
     155                /* This is not critical for Main, so don't set hr --
     156                 * we will take care of rc then. */
    168157            }
     158            if (   RT_SUCCESS(rc)
     159                && aObjInfo) /* Do we want object details? */
     160            {
     161                hr = executeStreamQueryFsObjInfo(aFile, stdOut[0],
     162                                                 aObjInfo, enmAddAttribs);
     163            }
     164
     165            if (pRC)
     166                *pRC = rc;
    169167        }
    170168    }
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