summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2024-05-08 14:46:58 +0200
committerJoe Orton <jorton@apache.org>2024-05-08 14:46:58 +0200
commitac774f7340bd1e2bb5ff092e27e75cd0051f7783 (patch)
treeef5771c7168ee7173ddfe58d5849d57fc89a1f0b /server
parent* modules/proxy/mod_proxy_fcgi.c (dispatch): Only allocate a heap (diff)
downloadapache2-ac774f7340bd1e2bb5ff092e27e75cd0051f7783.tar.xz
apache2-ac774f7340bd1e2bb5ff092e27e75cd0051f7783.zip
On Linux use the real thread id via gettid() in error logging,
where available, rather than the (meaningless) default pthread_self()-as-integer interpretation: * configure.in: Define DEFAULT_LOG_TID on Linux if gettid() is available. * server/log.c: Define DEFAULT_LOG_TID as NULL by default. (do_errorlog_default): Use DEFAULT_LOG_TID as the argument to log_tid(). Github: closes #443 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917578 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/log.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/log.c b/server/log.c
index 2f84635a75..1777a64615 100644
--- a/server/log.c
+++ b/server/log.c
@@ -69,6 +69,10 @@
#undef APLOG_MODULE_INDEX
#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
+#ifndef DEFAULT_LOG_TID
+#define DEFAULT_LOG_TID NULL
+#endif
+
typedef struct {
const char *t_name;
int t_val;
@@ -907,7 +911,7 @@ static int do_errorlog_default(const ap_errorlog_info *info, char *buf,
#if APR_HAS_THREADS
field_start = len;
len += cpystrn(buf + len, ":tid ", buflen - len);
- item_len = log_tid(info, NULL, buf + len, buflen - len);
+ item_len = log_tid(info, DEFAULT_LOG_TID, buf + len, buflen - len);
if (!item_len)
len = field_start;
else