]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: fix build with older glibc
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 22 Feb 2023 19:43:52 +0000 (20:43 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 Feb 2023 21:57:44 +0000 (06:57 +0900)
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

index d0d29818c2fc2f0cefb03017169584cd244518b3..00c53f6d5b8cad3bbfea379e6a20af09dfd5e602 100644 (file)
@@ -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"