Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit 1e397ca

Browse files
SteveSimpsonSteve Simpsoncarlwgeorge
authored
Merge of 2.4.46 Changes (#38)
Co-authored-by: Steve Simpson <[email protected]> Co-authored-by: Carl George <[email protected]>
1 parent 9af4144 commit 1e397ca

File tree

5 files changed

+582
-5
lines changed

5 files changed

+582
-5
lines changed

httpd-2.4.43-detect-systemd.patch

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Makefile.in b/Makefile.in
2-
index ea8366e..06b8c5a 100644
2+
index 0b088ac..9eeb5c7 100644
33
--- a/Makefile.in
44
+++ b/Makefile.in
55
@@ -4,7 +4,7 @@ CLEAN_SUBDIRS = test
@@ -11,8 +11,20 @@ index ea8366e..06b8c5a 100644
1111
PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
1212
PROGRAM_DEPENDENCIES = \
1313
server/libmain.la \
14+
diff --git a/acinclude.m4 b/acinclude.m4
15+
index 2a7e5d1..eb28321 100644
16+
--- a/acinclude.m4
17+
+++ b/acinclude.m4
18+
@@ -624,6 +624,7 @@ case $host in
19+
if test "${ac_cv_header_systemd_sd_daemon_h}" = "no" || test -z "${SYSTEMD_LIBS}"; then
20+
AC_MSG_WARN([Your system does not support systemd.])
21+
else
22+
+ APR_ADDTO(HTTPD_LIBS, [$SYSTEMD_LIBS])
23+
AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported])
24+
fi
25+
fi
1426
diff --git a/configure.in b/configure.in
15-
index f276550..a63eada 100644
27+
index 3618a5a..74a782b 100644
1628
--- a/configure.in
1729
+++ b/configure.in
1830
@@ -234,6 +234,7 @@ if test "$PCRE_CONFIG" != "false"; then
@@ -23,12 +35,11 @@ index f276550..a63eada 100644
2335
else
2436
AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
2537
fi
26-
@@ -679,6 +682,7 @@ APACHE_SUBST(OS_DIR)
38+
@@ -710,6 +711,7 @@ APACHE_SUBST(OS_DIR)
2739
APACHE_SUBST(BUILTIN_LIBS)
2840
APACHE_SUBST(SHLIBPATH_VAR)
2941
APACHE_SUBST(OS_SPECIFIC_VARS)
3042
+APACHE_SUBST(HTTPD_LIBS)
3143

3244
PRE_SHARED_CMDS='echo ""'
3345
POST_SHARED_CMDS='echo ""'
34-

httpd-2.4.43-gettid.patch

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
From d4e5b6e1e5585d341d1e51f1ddc637c099111076 Mon Sep 17 00:00:00 2001
2+
From: Joe Orton <[email protected]>
3+
Date: Tue, 7 Jul 2020 09:48:01 +0100
4+
Subject: [PATCH] Check and use gettid() directly with glibc 2.30+.
5+
6+
* configure.in: Check for gettid() and define HAVE_SYS_GETTID if
7+
gettid() is only usable via syscall().
8+
9+
* server/log.c (log_tid): Use gettid() directly if available.
10+
---
11+
configure.in | 14 +++++++++-----
12+
server/log.c | 8 ++++++--
13+
2 files changed, 15 insertions(+), 7 deletions(-)
14+
15+
diff --git a/configure.in b/configure.in
16+
index 423d58d4b9a..60cbf7b7f81 100644
17+
--- httpd-2.4.43/configure.in.gettid
18+
+++ httpd-2.4.43/configure.in
19+
@@ -478,7 +500,8 @@
20+
timegm \
21+
getpgid \
22+
fopen64 \
23+
-getloadavg
24+
+getloadavg \
25+
+gettid
26+
)
27+
28+
dnl confirm that a void pointer is large enough to store a long integer
29+
@@ -489,16 +512,19 @@
30+
APR_ADDTO(HTTPD_LIBS, [-lselinux])
31+
])
32+
33+
-AC_CACHE_CHECK([for gettid()], ac_cv_gettid,
34+
+if test $ac_cv_func_gettid = no; then
35+
+ # On Linux before glibc 2.30, gettid() is only usable via syscall()
36+
+ AC_CACHE_CHECK([for gettid() via syscall], ap_cv_gettid,
37+
[AC_TRY_RUN(#define _GNU_SOURCE
38+
#include <unistd.h>
39+
#include <sys/syscall.h>
40+
#include <sys/types.h>
41+
int main(int argc, char **argv) {
42+
pid_t t = syscall(SYS_gettid); return t == -1 ? 1 : 0; },
43+
-[ac_cv_gettid=yes], [ac_cv_gettid=no], [ac_cv_gettid=no])])
44+
-if test "$ac_cv_gettid" = "yes"; then
45+
- AC_DEFINE(HAVE_GETTID, 1, [Define if you have gettid()])
46+
+ [ap_cv_gettid=yes], [ap_cv_gettid=no], [ap_cv_gettid=no])])
47+
+ if test "$ap_cv_gettid" = "yes"; then
48+
+ AC_DEFINE(HAVE_SYS_GETTID, 1, [Define if you have gettid() via syscall()])
49+
+ fi
50+
fi
51+
52+
dnl ## Check for the tm_gmtoff field in struct tm to get the timezone diffs
53+
--- httpd-2.4.43/server/log.c.gettid
54+
+++ httpd-2.4.43/server/log.c
55+
@@ -55,7 +55,7 @@
56+
#include "ap_mpm.h"
57+
#include "ap_listen.h"
58+
59+
-#if HAVE_GETTID
60+
+#if HAVE_SYS_GETTID
61+
#include <sys/syscall.h>
62+
#include <sys/types.h>
63+
#endif
64+
@@ -625,14 +625,18 @@
65+
#if APR_HAS_THREADS
66+
int result;
67+
#endif
68+
-#if HAVE_GETTID
69+
+#if defined(HAVE_GETTID) || defined(HAVE_SYS_GETTID)
70+
if (arg && *arg == 'g') {
71+
+#ifdef HAVE_GETTID
72+
+ pid_t tid = gettid();
73+
+#else
74+
pid_t tid = syscall(SYS_gettid);
75+
+#endif
76+
if (tid == -1)
77+
return 0;
78+
return apr_snprintf(buf, buflen, "%"APR_PID_T_FMT, tid);
79+
}
80+
-#endif
81+
+#endif /* HAVE_GETTID || HAVE_SYS_GETTID */
82+
#if APR_HAS_THREADS
83+
if (ap_mpm_query(AP_MPMQ_IS_THREADED, &result) == APR_SUCCESS
84+
&& result != AP_MPMQ_NOT_SUPPORTED)
85+
@@ -966,7 +970,7 @@
86+
#if APR_HAS_THREADS
87+
field_start = len;
88+
len += cpystrn(buf + len, ":tid ", buflen - len);
89+
- item_len = log_tid(info, NULL, buf + len, buflen - len);
90+
+ item_len = log_tid(info, "g", buf + len, buflen - len);
91+
if (!item_len)
92+
len = field_start;
93+
else

0 commit comments

Comments
 (0)