From 6cd9c020ea8923af57b7f6725765e60900f1b646 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 19 Aug 2019 17:25:49 +0200 Subject: [PATCH] LibC: Write to the dbg() every time we perror() in userspace There's a high chance that we're interested in whatever errors come out of perror(), so let's output those on the debugger as well. --- Libraries/LibC/stdio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 713853caaf..84c1d94996 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -424,6 +425,7 @@ int snprintf(char* buffer, size_t size, const char* fmt, ...) void perror(const char* s) { + dbg() << "perror(): " << strerror(errno); fprintf(stderr, "%s: %s\n", s, strerror(errno)); }