mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
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:
parent
91c79440a1
commit
6cd9c020ea
Notes:
sideshowbarker
2024-07-19 12:35:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6cd9c020ea8
1 changed files with 2 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue