printfmt: print cur_errbuf as part of %e
authorRonald G. Minnich <rminnich@gmail.com>
Sat, 9 Aug 2014 03:27:57 +0000 (03:27 +0000)
committerRonald G. Minnich <rminnich@gmail.com>
Sat, 9 Aug 2014 03:27:57 +0000 (03:27 +0000)
Of course, now we should start initializing first element to 0 when we
do a system call, I guess, as it's printing garbage sometimes.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
kern/src/printfmt.c

index fc778f5..48258c6 100644 (file)
@@ -151,9 +151,9 @@ void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_li
                        if (err < 0)
                                err = -err;
                        if (err >= NUMERRORS)
-                               printfmt(putch, putdat, "error %d", err);
+                               printfmt(putch, putdat, "error %d(%s)", err, get_cur_errbuf());
                        else
-                               printfmt(putch, putdat, "%s", error_string[err]);
+                               printfmt(putch, putdat, "%s (%s)", error_string[err], get_cur_errbuf());
                        break;
 
                case 'E': // ENET MAC