suppress write() output after panic()
This commit is contained in:
parent
2ec9c6ed66
commit
db067d24da
|
@ -66,6 +66,12 @@ int
|
||||||
consolewrite(int user_src, uint64 src, int n)
|
consolewrite(int user_src, uint64 src, int n)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
extern volatile int panicked; // from printf.c
|
||||||
|
|
||||||
|
if(panicked){
|
||||||
|
for(;;)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
acquire(&cons.lock);
|
acquire(&cons.lock);
|
||||||
for(i = 0; i < n; i++){
|
for(i = 0; i < n; i++){
|
||||||
|
|
|
@ -121,7 +121,7 @@ panic(char *s)
|
||||||
printf("panic: ");
|
printf("panic: ");
|
||||||
printf(s);
|
printf(s);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
panicked = 1; // freeze other CPUs
|
panicked = 1; // freeze output from other CPUs
|
||||||
for(;;)
|
for(;;)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue