From e1f29c259dc1c353513bed1074229c9461e9de48 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 27 Sep 2022 10:35:26 -0300 Subject: [PATCH] seek: actually act properly --- src/sys/syscalls/lseek.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/sys/syscalls/lseek.c b/src/sys/syscalls/lseek.c index 57daa3bf..d9847850 100644 --- a/src/sys/syscalls/lseek.c +++ b/src/sys/syscalls/lseek.c @@ -41,27 +41,13 @@ syscallret syscall_lseek(int ifd, off_t offset, int whence){ goto _ret; } } - + switch(whence){ case SEEK_SET: - if(offset < 0 || offset > fsize){ - retv.errno = EINVAL; - goto _ret; - } newoffset = offset; break; case SEEK_CUR: newoffset += offset; - if(offset == 0){ - retv.errno = 0; - retv.ret = fd->offset; - goto _ret; - } - if(newoffset < 0 || newoffset > fsize){ - retv.errno = EINVAL; - goto _ret; - } - if(newoffset < offset){ retv.errno = EOVERFLOW; goto _ret;