Fix: logging: log_add_time() save/restore errno
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Apr 2019 16:41:12 +0000 (12:41 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 10 Apr 2019 23:36:37 +0000 (19:36 -0400)
commit9f1053713656f28d01552540067b8887546a574c
treeb53c9c4012351c442e796e668fbff1ba4194b0c9
parent44a019c230262b94d8cbd2075cfbebccbe75dfc1
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>
src/common/error.c
This page took 0.02616 seconds and 5 git commands to generate.