1
0
mirror of https://github.com/armink/EasyLogger.git synced 2025-01-19 07:42:52 +08:00

Merge pull request #126 from cddjr/master

fix issue #33
This commit is contained in:
朱天龙 (Armink) 2022-09-14 17:47:27 +08:00 committed by GitHub
commit f18ca0a70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@
#include <pthread.h>
#include <unistd.h>
#include <time.h>
#include <sys/syscall.h>
#ifdef ELOG_FILE_ENABLE
#include <elog_file.h>
@ -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;
}