From a90d9ee1620ce65ecf07224f2d2d16f9f5c48ca9 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 22 Feb 2023 20:43:52 +0100 Subject: [PATCH] sd-journal: fix build with older glibc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In older glibc (like 2.28 on CentOS Stream 8) there is no wrapper for the gettid() syscall, so we need to provide our own. ../src/libsystemd/sd-journal/journal-send.c: In function ‘close_journal_fd’: ../src/libsystemd/sd-journal/journal-send.c:88:25: error: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Werror=implicit-function-declaration] if (getpid() != gettid()) ^~~~~~ getgid ../src/libsystemd/sd-journal/journal-send.c:88:25: warning: nested extern declaration of ‘gettid’ [-Wnested-externs] cc1: some warnings being treated as errors Follow-up to 50b35193ec. --- src/libsystemd/sd-journal/journal-send.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c index d0d29818c2f..00c53f6d5b8 100644 --- a/src/libsystemd/sd-journal/journal-send.c +++ b/src/libsystemd/sd-journal/journal-send.c @@ -21,6 +21,7 @@ #include "io-util.h" #include "journal-send.h" #include "memfd-util.h" +#include "missing_syscall.h" #include "socket-util.h" #include "stdio-util.h" #include "string-util.h" -- 2.47.3