From 811cfc5f70bc8f2cdabc04a77c2b421d00a0f7af Mon Sep 17 00:00:00 2001
From: Alex Stratford <alexander3.stratford@live.uwe.ac.uk>
Date: Tue, 3 Dec 2019 22:31:16 +0000
Subject: [PATCH] Dealing with issues brought up in merge request !12
 syscall_exit.c line 15..16: Condensed into one line line 23: Removed for
 being unnescessary system_calls.h line 15: Made prototype consistent with
 declaration

---
 userprog/syscall_exit.c | 6 +-----
 userprog/system_calls.h | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/userprog/syscall_exit.c b/userprog/syscall_exit.c
index 3109de5..df33e35 100644
--- a/userprog/syscall_exit.c
+++ b/userprog/syscall_exit.c
@@ -12,13 +12,9 @@
 #include "threads/thread.h" // Dependency for thread struct
 
 void syscall_exit(struct intr_frame *f) {
-	struct thread *current_thread;	// creates thread struct from thread.h
-	current_thread = thread_current(); // Sets current thread
-
+	struct thread *current_thread = thread_current(); // Sets current thread
 	// pop off first int argument from interrupt frame
 	int exit_code = *((int*)f->esp + 1);
 	current_thread->exit_code = exit_code; // Returns exit code to kernel
-
 	thread_exit(); // Exiting current thread
-	f->eax = -1; // Returning -1 for success
 }
\ No newline at end of file
diff --git a/userprog/system_calls.h b/userprog/system_calls.h
index daed0ed..6fadcd1 100644
--- a/userprog/system_calls.h
+++ b/userprog/system_calls.h
@@ -12,7 +12,7 @@ void syscall_halt(struct intr_frame *f);
  * returned. Conventionally, a status of 0 indicates success and nonzero
  * values indicate errors. 
  */
-void syscall_exit(struct intr_frame *status);
+void syscall_exit(struct intr_frame *f);
 
 /*
  * Runs the executable whose name is given in cmd_line, passing any given
-- 
GitLab