VirtualBox

Changeset 1581 in vbox


Ignore:
Timestamp:
Mar 20, 2007 8:21:21 PM (18 years ago)
Author:
vboxsync
Message:

r=bird: Too verbose comments that just repeated the code (fixed).

File:
1 edited

Legend:

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

    r1532 r1581  
    7777
    7878/**
    79  * This is a helper to check if an attempt is made to grow a file beyond the
     79 * This is a helper to check if an attempt was made to grow a file beyond the
    8080 * limit of the filesystem.
    8181 *
     
    8484 * @param   offSeek     Offset to seek.
    8585 */
    86 inline bool IsBeyondLimit(RTFILE File, uint64_t offSeek, unsigned uMethod)
     86DECLINLINE(bool) IsBeyondLimit(RTFILE File, uint64_t offSeek, unsigned uMethod)
    8787{
    8888    bool fIsBeyondLimit = false;
    89     /*
    90      * Get current file pointer.
    91      */
    92     uint64_t    offCurrent;
     89
     90    /*
     91     * Get the current file position and try set the new one.
     92     * If it fails with a seek error it's because we hit the file system limit.
     93     */
     94    uint64_t offCurrent;
    9395    if (MySetFilePointer(File, 0, &offCurrent, FILE_CURRENT))
    9496    {
    95         /*
    96          * Set new file pointer.
    97          */
    9897        if (!MySetFilePointer(File, offSeek, NULL, uMethod))
    99         {
    100             /*
    101              * Failed to set new file pointer.
    102              */
    103             fIsBeyondLimit = (GetLastError() == ERROR_SEEK);
    104         }
    105         else
    106         {
    107             /*
    108              * Restore file pointer.
    109              */
     98            fIsBeyondLimit = GetLastError() == ERROR_SEEK;
     99        else /* Restore file pointer on success. */
    110100            MySetFilePointer(File, offCurrent, NULL, FILE_BEGIN);
    111         }
    112101    }
    113102
    114103    return fIsBeyondLimit;
    115104}
    116 
    117 
    118105
    119106
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