suppress write() output after panic()

This commit is contained in:
Robert Morris 2020-08-28 05:44:09 -04:00
parent 2ec9c6ed66
commit db067d24da
2 changed files with 7 additions and 1 deletions

View file

@ -66,6 +66,12 @@ int
consolewrite(int user_src, uint64 src, int n)
{
int i;
extern volatile int panicked; // from printf.c
if(panicked){
for(;;)
;
}
acquire(&cons.lock);
for(i = 0; i < n; i++){

View file

@ -121,7 +121,7 @@ panic(char *s)
printf("panic: ");
printf(s);
printf("\n");
panicked = 1; // freeze other CPUs
panicked = 1; // freeze output from other CPUs
for(;;)
;
}