mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibC: Don't clobber errno in dbgprintf().
This commit is contained in:
parent
f1f3cd58b0
commit
e20aecefba
1 changed files with 2 additions and 0 deletions
|
@ -295,10 +295,12 @@ int dbgprintf(const char* fmt, ...)
|
|||
{
|
||||
// if this fails, you're printing too early.
|
||||
ASSERT(stddbg);
|
||||
int errno_backup = errno;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int ret = vfprintf(stddbg, fmt, ap);
|
||||
va_end(ap);
|
||||
errno = errno_backup;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue