syscalls: let open syscall work with directories
This commit is contained in:
@@ -298,7 +298,11 @@ int sys_open(TrapFrame *tf)
|
||||
l9660_seekdir(&temp_dir, 0);
|
||||
int status = follow_path(filename, file, &temp_dir);
|
||||
|
||||
if (status != L9660_OK) {
|
||||
if(status == L9660_ENOTFILE)
|
||||
{
|
||||
current->file_descriptors[fd] = (l9660_file*)&temp_dir;
|
||||
}
|
||||
else if (status != L9660_OK) {
|
||||
free(file);
|
||||
return -2; // -ENOENT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user