svn commit: r230171 - stable/9/sys/cddl/compat/opensolaris/kern
Andriy Gapon
avg at FreeBSD.org
Sun Jan 15 22:07:15 UTC 2012
Author: avg
Date: Sun Jan 15 22:07:14 2012
New Revision: 230171
URL: http://svn.freebsd.org/changeset/base/230171
Log:
MFC r228710: opensolaris compat: fix vcmn_err so that panic(9) produces
a proper message
Modified:
stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c
==============================================================================
--- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sun Jan 15 22:05:15 2012 (r230170)
+++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sun Jan 15 22:07:14 2012 (r230171)
@@ -28,29 +28,35 @@ void
vcmn_err(int ce, const char *fmt, va_list adx)
{
char buf[256];
+ const char *prefix;
+ prefix = NULL; /* silence unwitty compilers */
switch (ce) {
case CE_CONT:
- snprintf(buf, sizeof(buf), "Solaris(cont): %s\n", fmt);
+ prefix = "Solaris(cont): ";
break;
case CE_NOTE:
- snprintf(buf, sizeof(buf), "Solaris: NOTICE: %s\n", fmt);
+ prefix = "Solaris: NOTICE: ";
break;
case CE_WARN:
- snprintf(buf, sizeof(buf), "Solaris: WARNING: %s\n", fmt);
+ prefix = "Solaris: WARNING: ";
break;
case CE_PANIC:
- snprintf(buf, sizeof(buf), "Solaris(panic): %s\n", fmt);
+ prefix = "Solaris(panic): ";
break;
case CE_IGNORE:
break;
default:
panic("Solaris: unknown severity level");
}
- if (ce == CE_PANIC)
- panic("%s", buf);
- if (ce != CE_IGNORE)
- vprintf(buf, adx);
+ if (ce == CE_PANIC) {
+ vsnprintf(buf, sizeof(buf), fmt, adx);
+ panic("%s%s", prefix, buf);
+ }
+ if (ce != CE_IGNORE) {
+ printf("%s", prefix);
+ vprintf(fmt, adx);
+ }
}
void
More information about the svn-src-stable-9
mailing list