VirtualBox

Changeset 66698 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Apr 27, 2017 3:48:29 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115091
Message:

fatvfs: readonly check and build fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/filesystem/fatvfs.cpp

    r66691 r66698  
    17491749{
    17501750    PRTFSFATFILE pThis = (PRTFSFATFILE)pvThis;
     1751    PRTFSFATVOL  pVol  = pThis->Core.pVol;
    17511752    AssertReturn(pSgBuf->cSegs != 0, VERR_INTERNAL_ERROR_3);
    17521753    RT_NOREF(fBlocking);
     1754
     1755    if (pVol->fReadOnly)
     1756        return VERR_WRITE_PROTECT;
    17531757
    17541758    if (off == -1)
     
    17901794
    17911795        /* Figure the disk offset. */
    1792         uint64_t offDisk = rtFsFatChain_FileOffsetToDiskOff(&pThis->Core.Clusters, (uint32_t)off, pThis->Core.pVol);
     1796        uint64_t offDisk = rtFsFatChain_FileOffsetToDiskOff(&pThis->Core.Clusters, (uint32_t)off, pVol);
    17931797        if (offDisk != UINT64_MAX)
    17941798        {
    1795             rc = RTVfsFileWriteAt(pThis->Core.pVol->hVfsBacking, offDisk, pbSrc, cbToWrite, NULL);
     1799            rc = RTVfsFileWriteAt(pVol->hVfsBacking, offDisk, pbSrc, cbToWrite, NULL);
    17961800            if (RT_SUCCESS(rc))
    17971801            {
     
    26502654                                        uint32_t *poffEntryInDir, uint32_t *pcFreeTail)
    26512655{
     2656    /* First try make gcc happy. */
     2657    *pcFreeTail     = 0;
     2658    *poffEntryInDir = UINT32_MAX;
     2659
     2660    /*
     2661     * Scan the whole directory, buffer by buffer.
     2662     */
    26522663    uint32_t            offStartFreeEntries = UINT32_MAX;
    26532664    uint32_t            cFreeEntries        = 0;
     
    27132724        rtFsFatDir_ReleaseBufferAfterReading(pThis, uBufferLock);
    27142725    }
    2715 
    2716     *pcFreeTail     = cFreeEntries;
    2717     *poffEntryInDir = UINT32_MAX;
     2726    *pcFreeTail = cFreeEntries;
    27182727    return VERR_DISK_FULL;
    27192728}
     
    28492858    PRTFSFATVOL pVol = pThis->Core.pVol;
    28502859    *poffEntryInDir = UINT32_MAX;
     2860    if (pVol->fReadOnly)
     2861        return VERR_WRITE_PROTECT;
    28512862
    28522863    /*
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