From f0e5da20e1a6e9b532f7de66079da5fa53e9d01c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 1 May 2020 12:26:03 +0200 Subject: [PATCH] BUG/MINOR: debug: properly use long long instead of long for the thread ID I changed my mind twice on this one and pushed after the last test with threads disabled, without re-enabling long long, causing this rightful build warning. This needs to be backported if the previous commit ff64d3b027 ("MINOR: threads: export the POSIX thread ID in panic dumps") is backported as well. --- include/common/hathreads.h | 2 +- src/debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/common/hathreads.h b/include/common/hathreads.h index 82357d5bd..95dfb051b 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -170,7 +170,7 @@ static inline void ha_set_tid(unsigned int tid) ti = &ha_thread_info[tid]; } -static inline unsigned long ha_get_pthread_id(unsigned int thr) +static inline unsigned long long ha_get_pthread_id(unsigned int thr) { return 0; } diff --git a/src/debug.c b/src/debug.c index a94fd2830..efbf19fe5 100644 --- a/src/debug.c +++ b/src/debug.c @@ -58,7 +58,7 @@ void ha_thread_dump(struct buffer *buf, int thr, int calling_tid) int stuck = !!(ha_thread_info[thr].flags & TI_FL_STUCK); chunk_appendf(buf, - "%c%cThread %-2u: id=0x%lx act=%d glob=%d wq=%d rq=%d tl=%d tlsz=%d rqsz=%d\n" + "%c%cThread %-2u: id=0x%llx act=%d glob=%d wq=%d rq=%d tl=%d tlsz=%d rqsz=%d\n" " stuck=%d prof=%d", (thr == calling_tid) ? '*' : ' ', stuck ? '>' : ' ', thr + 1, ha_get_pthread_id(thr),