diff --git a/userprog/syscall_filesize.c b/userprog/syscall_filesize.c index 8bdba551c98197a851636f5d306ce45d5d8b3467..c3eedaa2b69147aa3538d14bc94eb4533ac680d7 100644 --- a/userprog/syscall_filesize.c +++ b/userprog/syscall_filesize.c @@ -11,9 +11,9 @@ int syscall_filesize(struct intr_frame *f) { struct file_map *f_map; // Described in system_calls.h // pop off first int argument from interrupt frame f_map->file_descriptor = *((int*)f->esp + 1); - file_search(); + file_search(*f_map); if (f_map->file == NULL) { // Checking if file is empty or non-existent - return -1; // Returning failure state + f->eax -1; // Returning failure state } // Using the file_length function in file.h to get the length and store it int size = file_length(f_map->file);