VirtualBox

Changeset 28877 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Apr 28, 2010 7:10:47 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: pathhost changes.

Location:
trunk/src/VBox/Runtime/r3
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp

    r28849 r28877  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Path Convertions, generic.
     3 * IPRT - Path Convertions, Darwin.
     4 *
     5 * On darwin path names on the disk are decomposed using normalization
     6 * form D (NFD).  Since this behavior is unique for the Mac, we will precompose
     7 * the path name strings we get from the XNU kernel.
    48 */
    59
    610/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     11 * Copyright (C) 2006-2010 Oracle Corporation
    812 *
    913 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3842int rtPathToNative(char **ppszNativePath, const char *pszPath)
    3943{
    40     return RTStrUtf8ToCurrentCP(ppszNativePath, pszPath);
     44    /** @todo We should decompose the string here, but the file system will do
     45     *        that for us if we don't, so why bother. */
     46    *ppszNativePath = (char *)pszPath;
     47    return VINF_SUCCESS;
    4148}
     49
    4250
    4351int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath)
    4452{
    4553    NOREF(pszBasePath);
    46     return RTStrUtf8ToCurrentCP(ppszNativePath, pszPath);
     54    return rtPathToNative(ppszNativePath, pszPath);
    4755}
    4856
    49 void rtPathFreeNative(char *pszNativePath)
     57
     58void rtPathFreeNative(char *pszNativePath, const char *pszPath)
    5059{
    51     if (pszNativePath)
    52         RTStrFree(pszNativePath);
     60    Assert((const char *)pszNativePath == pszPath || !pszNativePath);
     61    NOREF(pszNativePath);
     62    NOREF(pszPath);
    5363}
    5464
     
    5666int rtPathFromNative(char **pszPath, const char *pszNativePath)
    5767{
    58     return RTStrCurrentCPToUtf8(pszPath, pszNativePath);
     68    /** @todo We must compose the codepoints in the string here.  We get file names
     69     *        in normalization form D so we'll end up with normalization form C
     70     *        whatever approach we take. */
     71    return RTStrDupEx(ppszPath, pszNativePath);
    5972}
    6073
     
    6376{
    6477    NOREF(pszBasePath);
    65     return RTStrCurrentCPToUtf8(pszPath, pszNativePath);
     78    return rtPathFromNative(ppszPath, pszNativePath);
    6679}
    6780
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r28800 r28877  
    7070            && S_ISDIR(s.st_mode);
    7171
    72         rtPathFreeNative(pszNativePath);
     72        rtPathFreeNative(pszNativePath, pszPath);
    7373    }
    7474
     
    110110        }
    111111
    112         rtPathFreeNative(pszNativePath);
     112        rtPathFreeNative(pszNativePath, pszPath);
    113113    }
    114114    else
     
    131131            rc = RTErrConvertFromErrno(errno);
    132132
    133         rtPathFreeNative(pszNativePath);
     133        rtPathFreeNative(pszNativePath, pszPath);
    134134    }
    135135
     
    196196            rc = RTErrConvertFromErrno(errno);
    197197
    198         rtPathFreeNative(pszNativePath);
     198        rtPathFreeNative(pszNativePath, pDir->pszPath);
    199199    }
    200200
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r28800 r28877  
    100100            && S_ISREG(s.st_mode);
    101101
    102         rtPathFreeNative(pszNativePath);
     102        rtPathFreeNative(pszNativePath, pszPath);
    103103    }
    104104
     
    212212    int fh = open(pszNativeFilename, fOpenMode, fMode);
    213213    int iErr = errno;
    214     rtPathFreeNative(pszNativeFilename);
     214    rtPathFreeNative(pszNativeFilename, pszFilename);
    215215#endif
    216216    if (fh >= 0)
     
    378378        if (unlink(pszNativeFilename) != 0)
    379379            rc = RTErrConvertFromErrno(errno);
    380         rtPathFreeNative(pszNativeFilename);
     380        rtPathFreeNative(pszNativeFilename, pszFilename);
    381381    }
    382382    return rc;
  • trunk/src/VBox/Runtime/r3/posix/fs-posix.cpp

    r28800 r28877  
    8181        else
    8282            rc = RTErrConvertFromErrno(errno);
    83         rtPathFreeNative(pszNativeFsPath);
     83        rtPathFreeNative(pszNativeFsPath, pszFsPath);
    8484    }
    8585
     
    115115        else
    116116            rc = RTErrConvertFromErrno(errno);
    117         rtPathFreeNative(pszNativeFsPath);
     117        rtPathFreeNative(pszNativeFsPath, pszFsPath);
    118118    }
    119119    LogFlow(("RTFsQuerySerial(%p:{%s}, %p:{%RX32}: returns %Rrc\n",
     
    155155        else
    156156            rc = RTErrConvertFromErrno(errno);
    157         rtPathFreeNative(pszNativeFsPath);
     157        rtPathFreeNative(pszNativeFsPath, pszFsPath);
    158158    }
    159159
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r28800 r28877  
    512512        else
    513513            rc = RTErrConvertFromErrno(errno);
    514         rtPathFreeNative(pszNativePath);
     514        rtPathFreeNative(pszNativePath, pszPath);
    515515    }
    516516
     
    615615            }
    616616        }
    617         rtPathFreeNative(pszNativePath);
     617        rtPathFreeNative(pszNativePath, pszPath);
    618618    }
    619619
     
    789789                     pszSrc, pszDst, fRename, fFileType, rc, errno));
    790790
    791             rtPathFreeNative(pszNativeDst);
     791            rtPathFreeNative(pszNativeDst, pszDst);
    792792        }
    793         rtPathFreeNative(pszNativeSrc);
     793        rtPathFreeNative(pszNativeSrc, pszSrc);
    794794    }
    795795    return rc;
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