kernel: seek: return an error on bad whence

This commit is contained in:
K. Lange 2019-12-15 17:08:21 +09:00
parent efba52c3dd
commit eebf910db2
1 changed files with 2 additions and 0 deletions

View File

@ -325,6 +325,8 @@ static int sys_seek(int fd, int offset, int whence) {
case 2:
FD_OFFSET(fd) = FD_ENTRY(fd)->length + offset;
break;
default:
return -EINVAL;
}
return FD_OFFSET(fd);
}