X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ferror.cpp;h=1bf9491c27d8c8295716722c63e3e9ccd59e86dd;hb=238fab718442f811eeba699216ca8e9d61cbadd0;hp=0ec467bcd7d282323a59ea4c2b275eeaa040f7d2;hpb=c922647daed3dd022be11980063b5fb816d8c091;p=lttng-tools.git diff --git a/src/common/error.cpp b/src/common/error.cpp index 0ec467bcd..1bf9491c2 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp @@ -6,19 +6,20 @@ */ #define _LGPL_SOURCE +#include "error.hpp" + +#include +#include +#include +#include + +#include + #include #include #include #include -#include -#include -#include -#include -#include - -#include "error.h" - /* * lttng_opt_abort_on_error: unset: -1, disabled: 0, enabled: 1. * Controlled by the LTTNG_ABORT_ON_ERROR environment variable. @@ -29,7 +30,7 @@ static int lttng_opt_abort_on_error = -1; DEFINE_URCU_TLS(struct log_time, error_log_time); DEFINE_URCU_TLS(const char *, logger_thread_name); -const char *log_add_time(void) +const char *log_add_time() { int ret; struct tm tm, *res; @@ -49,9 +50,13 @@ const char *log_add_time(void) } /* Format time in the TLS variable. */ - ret = snprintf(URCU_TLS(error_log_time).str, sizeof(URCU_TLS(error_log_time).str), - "%02d:%02d:%02d.%09ld", - tm.tm_hour, tm.tm_min, tm.tm_sec, tp.tv_nsec); + ret = snprintf(URCU_TLS(error_log_time).str, + sizeof(URCU_TLS(error_log_time).str), + "%02d:%02d:%02d.%09ld", + tm.tm_hour, + tm.tm_min, + tm.tm_sec, + tp.tv_nsec); if (ret < 0) { goto error; } @@ -84,8 +89,7 @@ void logger_set_thread_name(const char *name, bool set_pthread_name) /* * Human readable error message. */ -static -const char *lttng_error_code_str(lttng_error_code code) +static const char *lttng_error_code_str(lttng_error_code code) { switch (code) { case LTTNG_OK: