- bugfix in syscall.c
- disable FILE_TYPE checks in lseek for testing purposes
This commit is contained in:
parent
1744238f28
commit
a4c870deca
1 changed files with 7 additions and 4 deletions
|
@ -44,14 +44,16 @@ static int sys_open(const char* name, int flags, int mode)
|
|||
file->mode = mode;
|
||||
file->flags = flags;
|
||||
check = open_fs(file, (char*) name);
|
||||
if (BUILTIN_EXPECT(check != -EINVAL, 0)) {
|
||||
if (check == -EINVAL) {
|
||||
/* file doesn't exist! */
|
||||
file->node = NULL;
|
||||
file->offset = 0;
|
||||
file->mode = 0;
|
||||
file->flags = 0;
|
||||
kprintf("Operation not permitted");
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fd >= NR_OPEN) {
|
||||
|
@ -85,9 +87,10 @@ static int sys_lseek(int fd, off_t pos, int origin)
|
|||
int ret = -EINVAL;
|
||||
fildes_t* file = &(per_core(current_task)->fildes_table[fd]);
|
||||
|
||||
if (BUILTIN_EXPECT(file->node->type != FS_FILE
|
||||
&& file->node->type != FS_CHARDEVICE, 0));
|
||||
return -EINVAL;
|
||||
// Disabled for testing purposes
|
||||
//if (BUILTIN_EXPECT(file->node->type != FS_FILE
|
||||
// && file->node->type != FS_CHARDEVICE, 0));
|
||||
// return -EINVAL;
|
||||
|
||||
switch(origin)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue