diff --git a/userprog/process.c b/userprog/process.c index 5cf724a3d6398386a858e009fe6d39a0ac44ef05..7aa158189374917306d5021e01bc54caea8b38fe 100644 --- a/userprog/process.c +++ b/userprog/process.c @@ -28,15 +28,15 @@ static bool load (const char *cmdline, void (**eip) (void), void **esp); tid_t process_execute (const char *command) { - char *fn_copy; + char *command_copy; tid_t tid; /* Make a copy of COMMAND. Otherwise there's a race between the caller and load(). */ - fn_copy = palloc_get_page (0); - if (fn_copy == NULL) + command_copy = palloc_get_page (0); + if (command_copy == NULL) return TID_ERROR; - strlcpy (fn_copy, command, PGSIZE); + strlcpy (command_copy, command, PGSIZE); /* Create a new thread to execute COMMAND. */ /* @@ -46,10 +46,10 @@ process_execute (const char *command) * then loading will fail. * NOTE: remove this comment block when argument parsing is implemented. */ - tid = thread_create (command, PRI_DEFAULT, start_process, fn_copy); + tid = thread_create (command, PRI_DEFAULT, start_process, command_copy); if (tid == TID_ERROR) - palloc_free_page (fn_copy); + palloc_free_page (command_copy); return tid; }