Commit 8c460e01 authored by Mark Andrews's avatar Mark Andrews
Browse files

3540. [bug] libt_api: t_info and t_assert were not thread safe.

parent d458ef4a
3540. [bug] libt_api: t_info and t_assert were not thread safe.
3539. [port] win32: timestamp format didn't match other platforms.
3538. [test] Running "make test" now requires loopback interfaces
......
......@@ -343,6 +343,7 @@ main(int argc, char **argv) {
void
t_assert(const char *component, int anum, int class, const char *what, ...) {
va_list args;
char buf[T_BIGBUF];
(void)printf("T:%s:%d:%s\n", component, anum, class == T_REQUIRED ?
"A" : "C");
......@@ -351,21 +352,22 @@ t_assert(const char *component, int anum, int class, const char *what, ...) {
* Format text to a buffer.
*/
va_start(args, what);
(void)vsnprintf(T_buf, sizeof(T_buf), what, args);
(void)vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
(void)t_putinfo("A", T_buf);
(void)t_putinfo("A", buf);
(void)printf("\n");
}
void
t_info(const char *format, ...) {
va_list args;
char buf[T_BIGBUF];
va_start(args, format);
(void) vsnprintf(T_buf, sizeof(T_buf), format, args);
(void) vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
(void) t_putinfo("I", T_buf);
(void) t_putinfo("I", buf);
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment