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 <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4199 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-04-10 02:26:25 +00:00
parent 1285dd1dad
commit 83dbc69d4e

View File

@@ -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);