]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: debug: properly use long long instead of long for the thread ID
authorWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 10:26:03 +0000 (12:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 10:26:03 +0000 (12:26 +0200)
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
src/debug.c

index 82357d5bd3bcd3f7a92ba59aecc01951cc81b2db..95dfb051b2cb20c810dd7fc169abf904ad983feb 100644 (file)
@@ -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;
 }
index a94fd28301fb27f18ee5b87da895636131b83ea3..efbf19fe58e56b2f984f293e56575874864ae7be 100644 (file)
@@ -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),