diff --git a/src/userprog/process.c b/src/userprog/process.c index 01f30d5..6c8ef2d 100644 --- a/src/userprog/process.c +++ b/src/userprog/process.c @@ -217,6 +217,8 @@ process_exit (void) struct thread *cur = thread_current (); uint32_t *pd; + printf ("%s: exit(%d)\n", cur->name, cur->exit_status); + /* Destroy the current process's page directory and switch back to the kernel-only page directory. */ pd = cur->pagedir; diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 9991156..1dbe73b 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -105,7 +105,6 @@ syscall_exit (int status) { /* Sets exit_status of the thread to status. thread_exit () will call process_exit () if user programs are allowed. */ - printf ("%s: exit(%d)\n", thread_current()->name, status); thread_current ()->exit_status = status; thread_exit (); }