Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä 2018-04-24 09:37:02 +03:00
commit 8f87f0fc6f
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 4 additions and 5 deletions

View File

@ -46,12 +46,11 @@ typedef enum { MES_RC_FAIL, MES_RC_SUCCESS, MES_RC_TIMEOUT } skygw_mes_rc_t;
static const char* timestamp_formatstr = "%04d-%02d-%02d %02d:%02d:%02d ";
/** One for terminating '\0' */
static const size_t timestamp_len = (4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 3 + 1 + 16) * sizeof(char);
static const size_t timestamp_len = (4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 3 + 1);
static const char* timestamp_formatstr_hp = "%04d-%02d-%02d %02d:%02d:%02d.%03d ";
/** One for terminating '\0' */
static const size_t timestamp_len_hp = (4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 3 + 3 + 1 + 16) *
sizeof(char);
static const size_t timestamp_len_hp = (4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 3 + 3 + 1);
struct skygw_thread_st
{

View File

@ -84,7 +84,7 @@ size_t snprint_timestamp(char* p_ts, size_t tslen)
t = time(NULL);
localtime_r(&t, &tm);
snprintf(p_ts, MXS_MIN(tslen, timestamp_len), timestamp_formatstr,
snprintf(p_ts, tslen, timestamp_formatstr,
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
tm.tm_min, tm.tm_sec);
rval = strlen(p_ts) * sizeof (char);
@ -125,7 +125,7 @@ size_t snprint_timestamp_hp(char* p_ts, size_t tslen)
gettimeofday(&tv, NULL);
localtime_r(&tv.tv_sec, &tm);
usec = tv.tv_usec / 1000;
snprintf(p_ts, MXS_MIN(tslen, timestamp_len_hp), timestamp_formatstr_hp,
snprintf(p_ts, tslen, timestamp_formatstr_hp,
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec, usec);
rval = strlen(p_ts) * sizeof (char);