VirtualBox

Ignore:
Timestamp:
Oct 22, 2009 12:34:22 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53801
Message:

*,RTFileOpen: Fixing RTFileOpen flag misdesign: The deny, access and action flags are mandatory now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r23903 r23973  
    181181    m->strFileName = aFileName;
    182182
    183     unsigned flags = 0;
     183    uint32_t flags = 0;
    184184    switch (aMode)
    185185    {
     186        /** @todo change to RTFILE_O_DENY_WRITE where appropriate. */
    186187        case Mode_Read:
    187             flags = RTFILE_O_READ;
     188            flags = RTFILE_O_READ      | RTFILE_O_OPEN           | RTFILE_O_DENY_NONE;
    188189            break;
    189190        case Mode_WriteCreate:      // fail if file exists
    190             flags = RTFILE_O_WRITE | RTFILE_O_CREATE;
     191            flags = RTFILE_O_WRITE     | RTFILE_O_CREATE         | RTFILE_O_DENY_NONE;
    191192            break;
    192193        case Mode_Overwrite:        // overwrite if file exists
    193             flags = RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE;
     194            flags = RTFILE_O_WRITE     | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE;
    194195            break;
    195196        case Mode_ReadWrite:
    196             flags = RTFILE_O_READ | RTFILE_O_WRITE;
    197     }
    198 
    199     int vrc = RTFileOpen (&m->handle, aFileName, flags);
    200     if (RT_FAILURE (vrc))
    201         throw EIPRTFailure (vrc);
     197            flags = RTFILE_O_READWRITE | RTFILE_O_OPEN           | RTFILE_O_DENY_NONE;;
     198    }
     199
     200    int vrc = RTFileOpen(&m->handle, aFileName, flags);
     201    if (RT_FAILURE(vrc))
     202        throw EIPRTFailure(vrc);
    202203
    203204    m->opened = true;
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