VirtualBox

Changeset 46014 in vbox for trunk


Ignore:
Timestamp:
May 13, 2013 11:55:58 AM (12 years ago)
Author:
vboxsync
Message:

RTDirQueryUnknownType* adjustment.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dir.h

    r46013 r46014  
    421421 *                          compose this, it's NOT sufficient to pass
    422422 *                          RTDIRENTRY::szName!
    423  * @param   fFollowSymLinks Whether to follow symbolic links or not.
     423 * @param   fFollowSymlinks Whether to follow symbolic links or not.
    424424 * @param   penmType        Pointer to the RTDIRENTRY::enmType member.  If this
    425  *                          is not RTDIRENTRYTYPE_UNKNOWN, the function will
    426  *                          return immediately without doing anything.  If it
    427  *                          is, it will use RTPathQueryInfo to try figure out
    428  *                          the correct value.  On failure, this will be
    429  *                          unchanged.
    430  */
    431 RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, bool fFollowSymLinks, RTDIRENTRYTYPE *penmType);
     425 *                          is not RTDIRENTRYTYPE_UNKNOWN and, if
     426 *                          @a fFollowSymlinks is false, not
     427 *                          RTDIRENTRYTYPE_SYMLINK, the function will return
     428 *                          immediately without doing anything.  Otherwise it
     429 *                          will use RTPathQueryInfo to try figure out the
     430 *                          correct value.  On failure, this will be unchanged.
     431 */
     432RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, bool fFollowSymlinks, RTDIRENTRYTYPE *penmType);
    432433
    433434/**
     
    439440 *                          compose this, it's NOT sufficient to pass
    440441 *                          RTDIRENTRY::szName!
    441  * @param   fFollowSymLinks Whether to follow symbolic links or not.
     442 * @param   fFollowSymlinks Whether to follow symbolic links or not.
    442443 * @param   penmType        Pointer to the RTDIRENTRY::enmType member or
    443444 *                          similar.  Will NOT be checked on input.
    444445 * @param   pObjInfo        The object info buffer to use with RTPathQueryInfo.
    445446 */
    446 RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, bool fFollowSymLinks, RTDIRENTRYTYPE *penmType, PRTFSOBJINFO pObjInfo);
     447RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, bool fFollowSymlinks, RTDIRENTRYTYPE *penmType, PRTFSOBJINFO pObjInfo);
    447448
    448449/**
  • trunk/src/VBox/Runtime/r3/dir.cpp

    r46013 r46014  
    732732
    733733
    734 RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, bool fFollowSymLinks,
     734RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, bool fFollowSymlinks,
    735735                                    RTDIRENTRYTYPE *penmType, PRTFSOBJINFO pObjInfo)
    736736{
    737737    int rc = RTPathQueryInfoEx(pszComposedName, pObjInfo, RTFSOBJATTRADD_NOTHING,
    738                                fFollowSymLinks ? RTPATH_F_FOLLOW_LINK : RTPATH_F_ON_LINK);
     738                               fFollowSymlinks ? RTPATH_F_FOLLOW_LINK : RTPATH_F_ON_LINK);
    739739    if (RT_FAILURE(rc))
    740740        return rc;
     
    763763
    764764
    765 RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, bool fFollowSymLinks, RTDIRENTRYTYPE *penmType)
    766 {
    767     if (*penmType != RTDIRENTRYTYPE_UNKNOWN)
     765RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, bool fFollowSymlinks, RTDIRENTRYTYPE *penmType)
     766{
     767    if (   *penmType != RTDIRENTRYTYPE_UNKNOWN
     768        && (   !fFollowSymlinks
     769            || *penmType != RTDIRENTRYTYPE_SYMLINK))
    768770        return VINF_SUCCESS;
    769771
    770772    RTFSOBJINFO ObjInfo;
    771     return RTDirQueryUnknownTypeEx(pszComposedName, fFollowSymLinks, penmType, &ObjInfo);
     773    return RTDirQueryUnknownTypeEx(pszComposedName, fFollowSymlinks, penmType, &ObjInfo);
    772774}
    773775
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