diff options
-rw-r--r-- | arch/powerpc/xmon/nonstdio.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c index 942d0f6b1874..bce3dcfe5058 100644 --- a/arch/powerpc/xmon/nonstdio.c +++ b/arch/powerpc/xmon/nonstdio.c | |||
@@ -111,13 +111,19 @@ char *xmon_gets(char *str, int nb) | |||
111 | void xmon_printf(const char *format, ...) | 111 | void xmon_printf(const char *format, ...) |
112 | { | 112 | { |
113 | va_list args; | 113 | va_list args; |
114 | int n; | ||
115 | static char xmon_outbuf[1024]; | 114 | static char xmon_outbuf[1024]; |
115 | int rc, n; | ||
116 | 116 | ||
117 | va_start(args, format); | 117 | va_start(args, format); |
118 | n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); | 118 | n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); |
119 | va_end(args); | 119 | va_end(args); |
120 | xmon_write(xmon_outbuf, n); | 120 | |
121 | rc = xmon_write(xmon_outbuf, n); | ||
122 | |||
123 | if (n && rc == 0) { | ||
124 | /* No udbg hooks, fallback to printk() - dangerous */ | ||
125 | printk(xmon_outbuf); | ||
126 | } | ||
121 | } | 127 | } |
122 | 128 | ||
123 | void xmon_puts(const char *str) | 129 | void xmon_puts(const char *str) |