From: Frantisek Sumsal Date: Wed, 22 Feb 2023 19:43:52 +0000 (+0100) Subject: sd-journal: fix build with older glibc X-Git-Tag: v254-rc1~1188 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a90d9ee1620ce65ecf07224f2d2d16f9f5c48ca9;p=thirdparty%2Fsystemd.git sd-journal: fix build with older glibc 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. --- 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"