X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Flib%2Fdebug.c;h=6d75e7a34c47bf25332d5a9cc24ac9cc153c217b;hp=7d520638c8cd9a9e8e60a3874b5ce5ae1dee7845;hb=5f1b986185717577aac1922544cb3a7b1a56b632;hpb=f6ed960fb20e2dc6607e6adf11461bf13fce5834 diff --git a/src/lib/debug.c b/src/lib/debug.c index 7d52063..6d75e7a 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -5,6 +5,7 @@ #include #include #ifdef KERNEL +#include "threads/init.h" #include "threads/interrupt.h" #include "devices/serial.h" #else @@ -89,7 +90,9 @@ debug_panic (const char *file, int line, const char *function, #ifdef KERNEL serial_flush (); - power_off (); + if (power_off_when_done) + power_off (); + for (;;); #else exit (1); #endif