lseek only works with FS_FILE. On failture, the result is -EINVAL

This commit is contained in:
Marian Ohligs 2011-05-19 11:11:18 +02:00
parent 9e5dcfc2b4
commit 33be04bfcd

View file

@ -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)
{