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
panic(char *fmt, ...)
{
int n, s;
int s;
va_list arg;
char buf[PRINTSIZE];
@ -253,17 +253,16 @@ panic(char *fmt, ...)
s = splhi();
strcpy(buf, "panic: ");
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);
iprint("%s\n", buf);
if(consdebug)
(*consdebug)();
splx(s);
prflush();
buf[n] = '\n';
putstrn(buf, n+1);
dumpstack();
if(!cpuserver)
for(;;);
exit(1);
}