- bugfix in syscall.c

- disable FILE_TYPE checks in lseek for testing purposes
This commit is contained in:
Marian Ohligs 2011-07-11 13:36:41 +02:00
parent 1744238f28
commit a4c870deca

View file

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