src/share/back/log_messages.c

Print this page
rev 9508 : 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
Reviewed-by:

*** 54,74 **** /* Ascii id of current native thread. */ static void get_time_stamp(char *tbuf, size_t ltbuf) { ! char format[MAXLEN_TIMESTAMP+1]; unsigned millisecs = 0; time_t t = 0; GETMILLSECS(millisecs); if ( time(&t) == (time_t)(-1) ) t = 0; ! (void)strftime(format, sizeof(format), /* Break this string up for SCCS's sake */ ! "%" "d.%" "m.%" "Y %" "T.%%.3d %" "Z", localtime(&t)); ! (void)snprintf(tbuf, ltbuf, format, (int)(millisecs)); } /* Get basename of filename */ static const char * file_basename(const char *file) --- 54,78 ---- /* Ascii id of current native thread. */ static void get_time_stamp(char *tbuf, size_t ltbuf) { ! char timestamp_prefix[MAXLEN_TIMESTAMP+1]; ! char timestamp_postfix[MAXLEN_TIMESTAMP+1]; unsigned millisecs = 0; time_t t = 0; GETMILLSECS(millisecs); if ( time(&t) == (time_t)(-1) ) t = 0; ! (void)strftime(timestamp_prefix, sizeof(timestamp_prefix), /* Break this string up for SCCS's sake */ ! "%" "d.%" "m.%" "Y %" "T", localtime(&t)); ! (void)strftime(timestamp_postfix, sizeof(timestamp_postfix), ! /* Break this string up for SCCS's sake */ ! "%" "Z", localtime(&t)); ! (void)snprintf(tbuf, ltbuf, "%s.%.3d %s", timestamp_prefix, (int)(millisecs), timestamp_postfix); } /* Get basename of filename */ static const char * file_basename(const char *file)
*** 173,183 **** messageID = ""; /* FIXUP: Unique message string ID? */ (void)snprintf(optional, sizeof(optional), "LOC=%s;PID=%d;THR=t@%d", location_stamp, (int)processPid, ! (int)tid); /* Construct message string. */ va_start(ap, format); (void)vsnprintf(message, sizeof(message), format, ap); va_end(ap); --- 177,187 ---- messageID = ""; /* FIXUP: Unique message string ID? */ (void)snprintf(optional, sizeof(optional), "LOC=%s;PID=%d;THR=t@%d", location_stamp, (int)processPid, ! (int)(intptr_t)tid); /* Construct message string. */ va_start(ap, format); (void)vsnprintf(message, sizeof(message), format, ap); va_end(ap);