Skip to content

Commit 5b1fb36

Browse files
committed
Fixed implicit declaration of GNU extension gettid
Fixes current compilation error (found on Ubuntu 24): ``` 23:16:48 log.c:637:21: error: implicit declaration of function 'gettid'; did you mean 'getgid'? [-Wimplicit-function-declaration] 23:16:48 637 | pid_t tid = gettid(); 23:16:48 | ^~~~~~ 23:16:48 | getgid ``` Ticket: ENT-13084 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 6e0eaed)
1 parent 02af011 commit 5b1fb36

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

deps-packaging/apache/debian/rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ build-stamp:
1414
dh_testdir
1515

1616
patch -p0 < $(CURDIR)/apachectl.patch
17+
18+
# Fixed implicit declaration of GNU extension gettid() (See ENT-13084)
19+
patch -p1 < $(CURDIR)/fixed-implicit-decl-gettid.patch
20+
1721
./configure \
1822
--prefix=$(PREFIX)/httpd \
1923
--enable-so \
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff -ruN httpd-2.4.63/server/log.c httpd-2.4.63-modified/server/log.c
2+
--- httpd-2.4.63/server/log.c 2024-06-21 16:31:54.000000000 +0200
3+
+++ httpd-2.4.63-modified/server/log.c 2025-06-30 16:51:30.836217481 +0200
4+
@@ -21,6 +21,8 @@
5+
*
6+
*/
7+
8+
+#define _GNU_SOURCE /* gettid() */
9+
+
10+
#include "apr.h"
11+
#include "apr_general.h" /* for signal stuff */
12+
#include "apr_strings.h"
13+
@@ -1461,7 +1463,7 @@
14+
15+
memset(buf, ' ', LOG_BYTES_BUFFER_SIZE - 1);
16+
buf[LOG_BYTES_BUFFER_SIZE - 1] = '\0';
17+
-
18+
+
19+
chars = buf; /* start character dump here */
20+
hex = buf + BYTES_LOGGED_PER_LINE + 1; /* start hex dump here */
21+
while (*off < len && this_time < BYTES_LOGGED_PER_LINE) {
22+
@@ -1533,7 +1535,7 @@
23+
}
24+
}
25+
26+
-AP_DECLARE(void) ap_log_data_(const char *file, int line,
27+
+AP_DECLARE(void) ap_log_data_(const char *file, int line,
28+
int module_index, int level,
29+
const server_rec *s, const char *label,
30+
const void *data, apr_size_t len,

0 commit comments

Comments
 (0)