diff --git a/Makefile.build b/Makefile.build
index 17d34f4f74406718bbc03bc925f52a177bc07ad8..cd6c9f0f5778a81d3814d6a2ad7a68c74b6531ba 100644
--- a/Makefile.build
+++ b/Makefile.build
@@ -63,6 +63,7 @@ userprog_SRC += userprog/syscall.c	# System call handler.
 userprog_SRC += userprog/gdt.c		# GDT initialization.
 userprog_SRC += userprog/tss.c		# TSS management.
 userprog_SRC += userprog/syscall_exec.c
+userprog_SRC += userprog/syscall_exit.c
 userprog_SRC += userprog/syscall_open.c
 userprog_SRC += userprog/syscall_halt.c
 userprog_SRC += userprog/syscall_wait.c
diff --git a/userprog/syscall.c b/userprog/syscall.c
index 39901d9ae563aac02ed7082a598f655eee82cc33..bfd235f882a10d965eadb22795940873b1d369dd 100644
--- a/userprog/syscall.c
+++ b/userprog/syscall.c
@@ -60,7 +60,6 @@ syscall_handler (struct intr_frame *f UNUSED)
     break;
   case SYSCALL_EXIT:
     syscall_exit(f);
-    thread_exit();
     break;
   case SYSCALL_EXEC:
     syscall_exec(f);