summaryrefslogtreecommitdiff
path: root/kernel/trap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trap.c')
-rw-r--r--kernel/trap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trap.c b/kernel/trap.c
index 27cfd32..eb7f6cf 100644
--- a/kernel/trap.c
+++ b/kernel/trap.c
@@ -53,6 +53,9 @@ usertrap(void)
if(r_scause() == 8){
// system call
+ if(p->killed)
+ exit();
+
// sepc points to the ecall instruction,
// but we want to return to the next instruction.
p->tf->epc += 4;