From: Mathieu Desnoyers Date: Tue, 2 Apr 2019 17:41:17 +0000 (-0400) Subject: Fix: logging: log_add_time() save/restore errno X-Git-Tag: v2.12.0-rc1~602 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=b1093e5fa7d006fb463b2754119c6d2796bb7d82;hp=b1093e5fa7d006fb463b2754119c6d2796bb7d82;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau ---