VirtualBox

Ignore:
Timestamp:
Jul 15, 2008 11:18:20 AM (16 years ago)
Author:
vboxsync
Message:

r=bird: The file mode is the 3rd argument to open. If no mode is specified, fall back to the default RT_FILE_PERMISSION.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r10634 r10644  
    164164            return VERR_INVALID_PARAMETER;
    165165    }
    166     /* Unix permissions */
    167     fOpenMode |= (fOpen & RTFILE_O_CREATE_MODE_MASK) >> RTFILE_O_CREATE_MODE_SHIFT;
     166
     167    /* File mode. */
     168    int fMode = (fOpen & RTFILE_O_CREATE_MODE_MASK)
     169              ? (fOpen & RTFILE_O_CREATE_MODE_MASK) >> RTFILE_O_CREATE_MODE_SHIFT
     170              : RT_FILE_PERMISSION;
    168171
    169172    /** @todo sharing! */
     
    173176     */
    174177#ifdef RT_DONT_CONVERT_FILENAMES
    175     int fh = open(pszFilename, fOpenMode, RT_FILE_PERMISSION);
     178    int fh = open(pszFilename, fOpenMode, fMode);
    176179    int iErr = errno;
    177180#else
     
    181184        return (rc);
    182185
    183     int fh = open(pszNativeFilename, fOpenMode, RT_FILE_PERMISSION);
     186    int fh = open(pszNativeFilename, fOpenMode, fMode);
    184187    int iErr = errno;
    185188    rtPathFreeNative(pszNativeFilename);
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