#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
#include <lttng/lttng-error.h>
#include <common/common.h>
struct tm tm, *res;
struct timespec tp;
time_t now;
+ const int errsv = errno;
ret = lttng_clock_gettime(CLOCK_REALTIME, &tp);
if (ret < 0) {
goto error;
}
+ errno = errsv;
return URCU_TLS(error_log_time).str;
error:
/* Return an empty string on error so logging is not affected. */
+ errno = errsv;
return "";
}