VirtualBox

Changeset 1491 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 14, 2007 7:50:46 PM (18 years ago)
Author:
vboxsync
Message:

Flush the config file before closing it to try prevent data loss on panic/fault/whatever. TODO: flush the directory too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r1397 r1491  
    197197            int vrc = RTFileOpen (&handle, vboxConfigFile,
    198198                                  RTFILE_O_READWRITE | RTFILE_O_CREATE |
    199                                   RTFILE_O_DENY_WRITE);
     199                                  RTFILE_O_DENY_WRITE | RTFILE_O_WRITE_THROUGH);
    200200            if (VBOX_SUCCESS (vrc))
    201201                vrc = RTFileWrite (handle,
     
    42044204                             Utf8Str (mData.mCfgFile.mName),
    42054205                             RTFILE_O_READWRITE | RTFILE_O_OPEN |
    4206                              RTFILE_O_DENY_WRITE);
     4206                             RTFILE_O_DENY_WRITE | RTFILE_O_WRITE_THROUGH);
    42074207        if (VBOX_FAILURE (vrc))
    42084208        {
     
    42424242    if (isConfigLocked())
    42434243    {
     4244        RTFileFlush (mData.mCfgFile.mHandle);
    42444245        RTFileClose (mData.mCfgFile.mHandle);
     4246        /** @todo flush the directory too. */
    42454247        mData.mCfgFile.mHandle = NIL_RTFILE;
    42464248        LogFlowThisFunc (("\n"));
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