VirtualBox

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


Ignore:
Timestamp:
Feb 18, 2008 1:19:02 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28186
Message:

r=bird: Close the file on failure.

File:
1 edited

Legend:

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

    r6984 r6991  
    108108     * If it fails with a seek error it's because we hit the file system limit.
    109109     */
    110 /** @todo r=bird: I'd be very interested to know on which versions of windows and on which file systems 
    111  * this supposedly works. The fastfat sources in the latest WDK makes no limit checks during 
     110/** @todo r=bird: I'd be very interested to know on which versions of windows and on which file systems
     111 * this supposedly works. The fastfat sources in the latest WDK makes no limit checks during
    112112 * file seeking, only at the time of writing (and some other odd ones we cannot make use of). */
    113113    uint64_t offCurrent;
     
    235235    if (fOpen & RTFILE_O_NOT_CONTENT_INDEXED)
    236236    {
    237         if (FALSE == SetFileAttributes(pszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
    238             return RTErrConvertFromWin32(GetLastError());
     237        if (!SetFileAttributes(pszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
     238        {
     239            rc = RTErrConvertFromWin32(GetLastError());
     240            CloseHandle(hFile);
     241            return rc;
     242        }
    239243    }
    240244#else
     
    264268    if (fOpen & RTFILE_O_NOT_CONTENT_INDEXED)
    265269    {
    266         if (FALSE == SetFileAttributesW(pwszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
     270        if (!SetFileAttributesW(pwszFilename, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
    267271        {
    268272            rc = RTErrConvertFromWin32(GetLastError());
     273            CloseHandle(hFile);
    269274            RTUtf16Free(pwszFilename);
    270275            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