The intention here is to make dprintf the de-facto function for
printing all debugging information. As such, it's useful to print to
the serial ports and stdout so that developers are not required to
hook up a serial port to view output.
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
void vdprintf(const char *format, va_list ap)
{
- int rv;
+ int rv, _rv;
char buffer[BUFFER_SIZE];
char *p;
static bool debug_init = false;
static bool debug_ok = false;
- rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
+ _rv = rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
if (rv < 0)
return;
p = buffer;
while (rv--)
debug_putc(*p++);
+
+ _fwrite(buffer, _rv, stdout);
}