- Timestamp:
- Oct 26, 2021 2:08:57 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/vfs/vfsstdfile.cpp
r82968 r92083 143 143 rc = RTFileRead( pThis->hFile, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbRead); 144 144 else 145 { 145 146 rc = RTFileReadAt(pThis->hFile, off, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbRead); 147 if (RT_SUCCESS(rc)) /* RTFileReadAt() doesn't increment the file-position indicator on some platforms */ 148 rc = RTFileSeek(pThis->hFile, off + (pcbRead ? *pcbRead : pSgBuf->paSegs[0].cbSeg), RTFILE_SEEK_BEGIN, NULL); 149 } 146 150 if (rc == VINF_SUCCESS && pcbRead) 147 151 rc = rtVfsStdFile_ReadFixRC(pThis, off, pSgBuf->paSegs[0].cbSeg, *pcbRead); … … 163 167 rc = RTFileRead( pThis->hFile, pvSeg, cbSeg, pcbRead ? &cbReadSeg : NULL); 164 168 else 169 { 165 170 rc = RTFileReadAt(pThis->hFile, off, pvSeg, cbSeg, pcbRead ? &cbReadSeg : NULL); 171 if (RT_SUCCESS(rc)) /* RTFileReadAt() doesn't increment the file-position indicator on some platforms */ 172 rc = RTFileSeek(pThis->hFile, off + cbReadSeg, RTFILE_SEEK_BEGIN, NULL); 173 } 166 174 if (RT_FAILURE(rc)) 167 175 break; … … 199 207 rc = RTFileWrite(pThis->hFile, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbWritten); 200 208 else 209 { 201 210 rc = RTFileWriteAt(pThis->hFile, off, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbWritten); 211 if (RT_SUCCESS(rc)) /* RTFileWriteAt() doesn't increment the file-position indicator on some platforms */ 212 rc = RTFileSeek(pThis->hFile, off + (pcbWritten ? *pcbWritten : pSgBuf->paSegs[0].cbSeg), RTFILE_SEEK_BEGIN, 213 NULL); 214 } 202 215 } 203 216 else … … 219 232 { 220 233 rc = RTFileWriteAt(pThis->hFile, off, pvSeg, cbSeg, pcbWrittenSeg); 221 off += cbSeg; 234 if (RT_SUCCESS(rc)) 235 { 236 off += pcbWrittenSeg ? *pcbWrittenSeg : cbSeg; 237 /* RTFileWriteAt() doesn't increment the file-position indicator on some platforms */ 238 rc = RTFileSeek(pThis->hFile, off, RTFILE_SEEK_BEGIN, NULL); 239 } 222 240 } 223 241 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.