From 01b774d9470bf317e42f8e4a764fd3b570db357d Mon Sep 17 00:00:00 2001
From: a2-stratford <alexander3.stratford@live.uwe.ac.uk>
Date: Mon, 2 Dec 2019 13:58:44 +0000
Subject: [PATCH] Update process.c to standardise parameter names

---
 userprog/process.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/userprog/process.c b/userprog/process.c
index 03cb20c..3218f12 100644
--- a/userprog/process.c
+++ b/userprog/process.c
@@ -223,7 +223,7 @@ static bool load_segment (struct file *file, off_t ofs, uint8_t *upage,
    and its initial stack pointer into *initial_stack_pointer.
    Returns true if successful, false otherwise. */
 bool
-load (const char *file_name, void (**eip) (void), void **initial_stack_pointer) 
+load (const char *cmdline, void (**eip) (void), void **initial_stack_pointer) 
 {
   struct thread *t = thread_current ();
   struct Elf32_Ehdr ehdr;
@@ -239,16 +239,16 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer)
   process_activate ();
 
   /* Open executable file. */
-  file = filesys_open (file_name);
+  file = filesys_open (cmdline);
 
   if (file == NULL) 
     {
-	printf ("load: %s: open failed\n", file_name);
+	printf ("load: %s: open failed\n", cmdline);
       goto done; 
     }
 
   /* Read and verify executable header. */
-  if (file_read (file, &ehdr, sizeof ehdr) != sizeof ehdr
+  if (cmdline (file, &ehdr, sizeof ehdr) != sizeof ehdr
       || memcmp (ehdr.e_ident, "\177ELF\1\1\1", 7)
       || ehdr.e_type != 2
       || ehdr.e_machine != 3
@@ -256,7 +256,7 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer)
       || ehdr.e_phentsize != sizeof (struct Elf32_Phdr)
       || ehdr.e_phnum > 1024) 
     {
-      printf ("load: %s: error loading executable\n", file_name);
+      printf ("load: %s: error loading executable\n", cmdline);
       goto done; 
     }
 
-- 
GitLab