X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Ferror.c;h=a7d6e1220a88be351397ce65bc919f16f2266234;hb=b1093e5fa7d006fb463b2754119c6d2796bb7d82;hp=dd1735dd4779094f35dd85c028ce156e488f6754;hpb=20f37cb4bb8799d9493eff17b11055bc81bd7dd3;p=lttng-tools.git diff --git a/src/common/error.c b/src/common/error.c index dd1735dd4..a7d6e1220 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,8 @@ 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", /* Last element */ [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"