From 83dbc69d4e83dfe3b3cb6e804487fc6d1b7ffba3 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 10 Apr 2012 02:26:25 +0000 Subject: [PATCH] scst: Fix debug_print_with_prefix() Terminate lines passed to debug_print_with_prefix() with a newline. Make sure that a formatting specification in an argument past "fmt" is printed literally instead of being interpreted as a format specification. The newlines are only missing when sending kernel logging to a remote system via netconsole and not when using local logging Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4199 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_debug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scst/src/scst_debug.c b/scst/src/scst_debug.c index c6a4c12d9..c01d00b62 100644 --- a/scst/src/scst_debug.c +++ b/scst/src/scst_debug.c @@ -89,11 +89,11 @@ int debug_print_with_prefix(unsigned long trace_flag, const char *severity, if (trace_flag & TRACE_LINE) i += snprintf(&trace_buf[i], TRACE_BUF_SIZE - i, "%i:", line); - va_start(args, fmt); - vsprintf(&trace_buf[i], fmt, args); - va_end(args); + i += snprintf(&trace_buf[i], TRACE_BUF_SIZE - i, "%s\n", fmt); - printk(trace_buf); + va_start(args, fmt); + vprintk(trace_buf, args); + va_end(args); spin_unlock_irqrestore(&trace_buf_lock, flags);