X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ferror.c;h=a87c53a89d90fc1ec91dcb9f6ca6a2b48a779002;hb=7fd975c523ee6e0bb45dcb13b7308b8d9d6406ba;hp=dd1735dd4779094f35dd85c028ce156e488f6754;hpb=20f37cb4bb8799d9493eff17b11055bc81bd7dd3;p=lttng-tools.git diff --git a/src/common/error.c b/src/common/error.c index dd1735dd4..a87c53a89 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ const char *log_add_time(void) struct tm tm, *res; struct timespec tp; time_t now; + const int errsv = errno; ret = lttng_clock_gettime(CLOCK_REALTIME, &tp); if (ret < 0) { @@ -65,10 +67,12 @@ const char *log_add_time(void) 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 ""; } @@ -208,6 +212,12 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER) ] = "Rotation pending check (relay) failure on consumer", [ ERROR_INDEX(LTTNG_ERR_MKDIR_FAIL_CONSUMER) ] = "mkdir failure on consumer", [ ERROR_INDEX(LTTNG_ERR_CHAN_NOT_FOUND) ] = "Channel not found", + [ ERROR_INDEX(LTTNG_ERR_SNAPSHOT_UNSUPPORTED) ] = "Session configuration does not allow the use of snapshots", + [ ERROR_INDEX(LTTNG_ERR_SESSION_NOT_EXIST) ] = "Tracing session does not exist", + [ ERROR_INDEX(LTTNG_ERR_CREATE_TRACE_CHUNK_FAIL_CONSUMER) ] = "Trace chunk creation failed on consumer", + [ ERROR_INDEX(LTTNG_ERR_CLOSE_TRACE_CHUNK_FAIL_CONSUMER) ] = "Trace chunk close failed on consumer", + [ ERROR_INDEX(LTTNG_ERR_TRACE_CHUNK_EXISTS_FAIL_CONSUMER) ] = "Failed to query consumer for trace chunk existence", + [ ERROR_INDEX(LTTNG_ERR_INVALID_PROTOCOL) ] = "Protocol error occurred", /* Last element */ [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"