mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
log: do not clobber errno
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
2a850b2ca6
commit
b7051eb7e6
@ -276,6 +276,7 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
{ \
|
{ \
|
||||||
if (lxc_log_priority_is_enabled(acategory, LXC_LOG_LEVEL_##LEVEL)) { \
|
if (lxc_log_priority_is_enabled(acategory, LXC_LOG_LEVEL_##LEVEL)) { \
|
||||||
va_list va_ref; \
|
va_list va_ref; \
|
||||||
|
int saved_errno; \
|
||||||
struct lxc_log_event evt = { \
|
struct lxc_log_event evt = { \
|
||||||
.category = (acategory)->name, \
|
.category = (acategory)->name, \
|
||||||
.priority = LXC_LOG_LEVEL_##LEVEL, \
|
.priority = LXC_LOG_LEVEL_##LEVEL, \
|
||||||
@ -287,12 +288,14 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
* without restrictions. So let's use it for our \
|
* without restrictions. So let's use it for our \
|
||||||
* logging stamps. \
|
* logging stamps. \
|
||||||
*/ \
|
*/ \
|
||||||
|
saved_errno = errno; \
|
||||||
(void)clock_gettime(CLOCK_REALTIME, &evt.timestamp); \
|
(void)clock_gettime(CLOCK_REALTIME, &evt.timestamp); \
|
||||||
\
|
\
|
||||||
va_start(va_ref, format); \
|
va_start(va_ref, format); \
|
||||||
evt.vap = &va_ref; \
|
evt.vap = &va_ref; \
|
||||||
__lxc_log(acategory, &evt); \
|
__lxc_log(acategory, &evt); \
|
||||||
va_end(va_ref); \
|
va_end(va_ref); \
|
||||||
|
errno = saved_errno; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user