From 89f9af8d456dab83a885eadb11a015709063044a Mon Sep 17 00:00:00 2001
From: Alex Stratford <alexander3.stratford@live.uwe.ac.uk>
Date: Wed, 4 Dec 2019 01:13:41 +0000
Subject: [PATCH] Fixed minor errors in syscall_filesize syscall_filesize.c
 line 14: Added passed in variable to file_search() line 16: Fixed return for
 failure state

---
 userprog/syscall_filesize.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/userprog/syscall_filesize.c b/userprog/syscall_filesize.c
index 8bdba55..c3eedaa 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); 
-- 
GitLab