1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix wrong return value of fdio_seek.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-09-07 12:39:13 +02:00
parent 29f5cd2335
commit 910197ffa7

View file

@ -79,13 +79,13 @@ static size_t fdio_write(const void* ptr, size_t size, size_t nmemb, void* user)
static int fdio_seek(void* user, off_t offset, int whence)
{
fdio_t* fdio = (fdio_t*) user;
return (int) lseek(fdio->fd, offset, whence);
return 0 <= lseek(fdio->fd, offset, whence) ? 0 : -1;
}
static off_t fdio_tell(void* user)
{
fdio_t* fdio = (fdio_t*) user;
return lseek(fdio->fd, 0, SEEK_CUR);
return lseek(fdio->fd, 0, SEEK_CUR);;
}
static void fdio_seterr(void* user)