Fix: logging: log_add_time() save/restore errno
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Apr 2019 17:41:17 +0000 (13:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Apr 2019 23:35:13 +0000 (19:35 -0400)
commit23649f1186d370ae42454b8f82c09ae77c5dbaf1
treeb6054814297cbad6b7b5b7f5113bb8ff7bc18d24
parentd49b54aade558422c35ecf9d62a33bf19b80cc51
Fix: logging: log_add_time() save/restore errno

The debugging logging macros (e.g. DBG()) are used as printf in the
lttng-tools source files. The printf() implementation does not alter the
errno value, so the fact that log_add_time() (through clock_gettime())
can alter errno is unexpected. For instance, adding a logging statement
for debugging purposes within a function for which errno is expected to
stay unchanged on return will change the behavior between execution with
-vvv and non-verbose.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/error.c
This page took 0.0250320000000001 seconds and 4 git commands to generate.