VirtualBox

Changeset 47665 in vbox


Ignore:
Timestamp:
Aug 12, 2013 10:11:42 AM (11 years ago)
Author:
vboxsync
Message:

Seems vdIfIoFileReadSync/vdIfIoFileWriteSync want real actual offsets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VDIfVfs.cpp

    r47515 r47665  
    8686     * This may end up being a little more complicated, esp. wrt VERR_EOF.
    8787     */
     88    if (off == -1)
     89        off = pThis->offCurPos;
    8890    int rc = vdIfIoFileReadSync(pThis->pVDIfsIo, pThis->pvStorage, off, pSgBuf[0].pvSegCur, pSgBuf->paSegs[0].cbSeg, pcbRead);
    8991    if (RT_SUCCESS(rc))
    90         pThis->offCurPos = (off == -1 ? pThis->offCurPos : off)
    91                          + (pcbRead ? *pcbRead : pSgBuf->paSegs[0].cbSeg);
     92        pThis->offCurPos = off + (pcbRead ? *pcbRead : pSgBuf->paSegs[0].cbSeg);
    9293    return rc;
    9394}
     
    105106     * This may end up being a little more complicated, esp. wrt VERR_EOF.
    106107     */
     108    if (off == -1)
     109        off = pThis->offCurPos;
    107110    int rc = vdIfIoFileWriteSync(pThis->pVDIfsIo, pThis->pvStorage, off, pSgBuf[0].pvSegCur, pSgBuf->paSegs[0].cbSeg, pcbWritten);
    108111    if (RT_SUCCESS(rc))
    109         pThis->offCurPos = (off == -1 ? pThis->offCurPos : off)
    110                          + (pcbWritten ? *pcbWritten : pSgBuf->paSegs[0].cbSeg);
     112        pThis->offCurPos = off + (pcbWritten ? *pcbWritten : pSgBuf->paSegs[0].cbSeg);
    111113    return rc;
    112114}
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