mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
make sure the log functions don't modify errno
This commit is contained in:
parent
c25fb0edbb
commit
c9b97d2a83
3
log.c
3
log.c
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
@ -18,6 +19,7 @@ void log_meta(
|
||||
|
||||
const char *prefix, *suffix;
|
||||
va_list ap;
|
||||
int saved_errno = errno;
|
||||
|
||||
if (LOG_PRI(level) <= LOG_ERR) {
|
||||
prefix = "\x1B[1;31m";
|
||||
@ -35,4 +37,5 @@ void log_meta(
|
||||
|
||||
va_end(ap);
|
||||
|
||||
errno = saved_errno;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user