panic(): dont print message twice. for terminals, dont auto reboot.

This commit is contained in:
cinap_lenrek 2011-12-13 16:07:52 +01:00
parent a03d9a7985
commit 36dc22fd57

View file

@ -240,7 +240,7 @@ iprint(char *fmt, ...)
void void
panic(char *fmt, ...) panic(char *fmt, ...)
{ {
int n, s; int s;
va_list arg; va_list arg;
char buf[PRINTSIZE]; char buf[PRINTSIZE];
@ -253,17 +253,16 @@ panic(char *fmt, ...)
s = splhi(); s = splhi();
strcpy(buf, "panic: "); strcpy(buf, "panic: ");
va_start(arg, fmt); va_start(arg, fmt);
n = vseprint(buf+strlen(buf), buf+sizeof(buf), fmt, arg) - buf; vseprint(buf+strlen(buf), buf+sizeof(buf), fmt, arg);
va_end(arg); va_end(arg);
iprint("%s\n", buf); iprint("%s\n", buf);
if(consdebug) if(consdebug)
(*consdebug)(); (*consdebug)();
splx(s); splx(s);
prflush(); prflush();
buf[n] = '\n';
putstrn(buf, n+1);
dumpstack(); dumpstack();
if(!cpuserver)
for(;;);
exit(1); exit(1);
} }