VirtualBox

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


Ignore:
Timestamp:
Jan 31, 2019 12:41:00 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128522
Message:

Guest Control/Main: Fixes for GuestSession::fileExist().

File:
1 edited

Legend:

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

    r77070 r77072  
    15761576}
    15771577
     1578/**
     1579 * Queries information from a file on the guest.
     1580 *
     1581 * @returns IPRT status code. VERR_NOT_A_FILE if the queried file system object on the guest is not a file,
     1582 *                            or VERR_GSTCTL_GUEST_ERROR if prcGuest contains more error information from the guest.
     1583 * @param   strPath           Absolute path of file to query information for.
     1584 * @param   fFollowSymlinks   Whether or not to follow symbolic links on the guest.
     1585 * @param   objData           Where to store the acquired information.
     1586 * @param   prcGuest          Where to store the guest rc. Optional.
     1587 */
    15781588int GuestSession::i_fileQueryInfo(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *prcGuest)
    15791589{
     
    35663576    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    35673577
     3578    /* By default we return non-existent. */
     3579    *aExists = FALSE;
     3580
    35683581    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    3569     {
    3570         *aExists = FALSE;
    35713582        return S_OK;
    3572     }
    35733583
    35743584    HRESULT hrc = i_isReadyExternal();
     
    35793589
    35803590    GuestFsObjData objData; int rcGuest;
    3581     int vrc = i_fileQueryInfo(aPath, aFollowSymlinks != FALSE, objData, &rcGuest);
     3591    int vrc = i_fileQueryInfo(aPath, RT_BOOL(aFollowSymlinks), objData, &rcGuest);
    35823592    if (RT_SUCCESS(vrc))
    35833593    {
     
    35893599    {
    35903600        case VERR_GSTCTL_GUEST_ERROR:
    3591             hrc = GuestProcess::i_setErrorExternal(this, rcGuest);
     3601        {
     3602            switch (rcGuest)
     3603            {
     3604                case VERR_PATH_NOT_FOUND:
     3605                    RT_FALL_THROUGH();
     3606                case VERR_FILE_NOT_FOUND:
     3607                    break;
     3608
     3609                default:
     3610                    hrc = GuestProcess::i_setErrorExternal(this, rcGuest);
     3611                    break;
     3612            }
     3613
    35923614            break;
    3593 
    3594 /** @todo r=bird: what about VERR_PATH_NOT_FOUND and VERR_FILE_NOT_FOUND?
    3595  *        Where does that get converted to *aExists = FALSE? */
     3615        }
     3616
    35963617        case VERR_NOT_A_FILE:
    3597             *aExists = FALSE;
    35983618            break;
    35993619
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