mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibC: Make sure perror() is consistent about the errno it prints
This commit is contained in:
parent
026a8be4e5
commit
ada1f504fd
Notes:
sideshowbarker
2024-07-19 12:09:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ada1f504fd1
1 changed files with 3 additions and 2 deletions
|
@ -425,8 +425,9 @@ 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));
|
||||
int saved_errno = errno;
|
||||
dbg() << "perror(): " << strerror(saved_errno);
|
||||
fprintf(stderr, "%s: %s\n", s, strerror(saved_errno));
|
||||
}
|
||||
|
||||
FILE* fopen(const char* pathname, const char* mode)
|
||||
|
|
Loading…
Add table
Reference in a new issue