mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
Cleanup filestream_tell
This commit is contained in:
parent
55a28eb8a3
commit
9b4bb51c2e
@ -308,12 +308,12 @@ ssize_t filestream_tell(RFILE *stream)
|
||||
if (!stream)
|
||||
goto error;
|
||||
#if defined(VITA) || defined(PSP)
|
||||
return sceIoLseek(stream->fd, 0, SEEK_CUR);
|
||||
if (sceIoLseek(stream->fd, 0, SEEK_CUR) < 0)
|
||||
goto error;
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
uint64_t pos = 0;
|
||||
if (cellFsLseek(stream->fd, 0, CELL_FS_SEEK_CUR, &pos) != CELL_FS_SUCCEEDED)
|
||||
goto error;
|
||||
return 0;
|
||||
#else
|
||||
#if defined(HAVE_BUFFERED_IO)
|
||||
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0)
|
||||
@ -325,9 +325,12 @@ ssize_t filestream_tell(RFILE *stream)
|
||||
if (stream->mapped && stream->hints & RFILE_HINT_MMAP)
|
||||
return stream->mappos;
|
||||
#endif
|
||||
return lseek(stream->fd, 0, SEEK_CUR);
|
||||
if (lseek(stream->fd, 0, SEEK_CUR) < 0)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user