diff --git a/userprog/syscall_open.c b/userprog/syscall_open.c index dcec481c0362416c23e88a15a9bfde5121464af0..386fa269c9cdc95f7b4a27ac02c1d916c79c9afa 100644 --- a/userprog/syscall_open.c +++ b/userprog/syscall_open.c @@ -11,10 +11,11 @@ #include "filesys/file.h" // Dependency for file_open and file struct void syscall_open(struct intr_frame *f) { + struct file_map *f_map; // Create f_map struct instance // pop off first int argument from interrupt frame - struct file_map *f_map->file_descriptor = *((int*)f->esp + 1); + f_map->file_descriptor = *((int*)f->esp + 1); // Described in system_calls.h, opens the file - f_map->file = file_open(file_descriptor); + f_map->file = file_open(f_map->file_descriptor); if (f_map->file == NULL) // Checking if file is empty or non-existent f->eax = -1; // Returning a failure state f->eax = f_map->file_descriptor; // Returning the file descriptor