Changeset 21045 in vbox for trunk/src/VBox/Runtime/r3/stream.cpp
- Timestamp:
- Jun 30, 2009 1:09:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/stream.cpp
r20823 r21045 299 299 if (pStream && pStream->u32Magic == RTSTREAM_MAGIC) 300 300 { 301 clearerr(pStream->pFile); 301 302 ASMAtomicXchgS32(&pStream->i32Error, VINF_SUCCESS); 302 303 rc = VINF_SUCCESS; … … 307 308 rc = VERR_INVALID_PARAMETER; 308 309 } 310 return rc; 311 } 312 313 314 /** 315 * Rewinds the stream. 316 * 317 * Stream errors will be reset on success. 318 * 319 * @returns IPRT status code. 320 * 321 * @param pStream The stream. 322 * 323 * @remarks Not all streams are rewindable and that behavior is currently 324 * undefined for those. 325 */ 326 RTR3DECL(int) RTStrmRewind(PRTSTREAM pStream) 327 { 328 AssertPtrReturn(pStream, VERR_INVALID_HANDLE); 329 AssertReturn(pStream->u32Magic == RTSTREAM_MAGIC, VERR_INVALID_HANDLE); 330 331 int rc; 332 clearerr(pStream->pFile); 333 errno = 0; 334 if (!fseek(pStream->pFile, 0, SEEK_SET)) 335 { 336 ASMAtomicXchgS32(&pStream->i32Error, VINF_SUCCESS); 337 rc = VINF_SUCCESS; 338 } 339 else 340 { 341 rc = RTErrConvertFromErrno(errno); 342 ASMAtomicXchgS32(&pStream->i32Error, rc); 343 } 344 309 345 return rc; 310 346 }
Note:
See TracChangeset
for help on using the changeset viewer.