Fix Bug in Process.c to print the exit statement in process_exit instead of exit syscall to handle unexpected/bad exits

This commit is contained in:
sBubshait
2024-11-07 12:15:29 +00:00
parent 6a3cf67d33
commit 39018419cd
2 changed files with 2 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 ();
}