From 1cd48f7072f17b687ce3eeaa00a829b63a5c0317 Mon Sep 17 00:00:00 2001 From: cddjr Date: Wed, 14 Sep 2022 17:36:15 +0800 Subject: [PATCH] fix issue #33 --- demo/os/linux/easylogger/port/elog_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/os/linux/easylogger/port/elog_port.c b/demo/os/linux/easylogger/port/elog_port.c index d36284e..98c81cd 100755 --- a/demo/os/linux/easylogger/port/elog_port.c +++ b/demo/os/linux/easylogger/port/elog_port.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef ELOG_FILE_ENABLE #include @@ -140,7 +141,7 @@ const char *elog_port_get_p_info(void) { const char *elog_port_get_t_info(void) { static char cur_thread_info[10] = { 0 }; - snprintf(cur_thread_info, 10, "tid:%04ld", pthread_self()); + snprintf(cur_thread_info, 10, "tid:%04d", syscall(SYS_gettid)); return cur_thread_info; }