lseek only works with FS_FILE. On failture, the result is -EINVAL
This commit is contained in:
parent
9e5dcfc2b4
commit
33be04bfcd
1 changed files with 3 additions and 1 deletions
|
@ -76,7 +76,9 @@ static int sys_lseek(int fd, off_t pos, int origin)
|
|||
{
|
||||
int ret = -EINVAL;
|
||||
|
||||
/* Beware: still not checking the filetype & size*/
|
||||
if (BUILTIN_EXPECT(per_core(current_task)->fildes_table[fd].node->type != FS_FILE, 0))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
switch(origin)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue