Cleanup filestream_tell

This commit is contained in:
twinaphex 2016-04-07 04:20:09 +02:00
parent 55a28eb8a3
commit 9b4bb51c2e

View File

@ -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;
}