ref: aada916f1e8d7fecc695c41d914bcad1784c4e63
parent: 2205735d55a07a8a127688a9554f11b129f261c4
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Tue Dec 13 11:07:52 EST 2011
panic(): dont print message twice. for terminals, dont auto reboot.
--- a/sys/src/9/port/devcons.c
+++ b/sys/src/9/port/devcons.c
@@ -240,7 +240,7 @@
void
panic(char *fmt, ...)
{- int n, s;
+ int s;
va_list arg;
char buf[PRINTSIZE];
@@ -253,7 +253,7 @@
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)
@@ -260,10 +260,9 @@
(*consdebug)();
splx(s);
prflush();
- buf[n] = '\n';
- putstrn(buf, n+1);
dumpstack();
-
+ if(!cpuserver)
+ for(;;);
exit(1);
}
--
⑨