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.
This commit is contained in:
Andreas Kling 2019-08-19 17:25:49 +02:00
parent 91c79440a1
commit 6cd9c020ea
Notes: sideshowbarker 2024-07-19 12:35:44 +09:00

View file

@ -1,3 +1,4 @@
#include <AK/LogStream.h>
#include <AK/PrintfImplementation.h>
#include <AK/ScopedValueRollback.h>
#include <AK/StdLibExtras.h>
@ -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));
}