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.
This commit is contained in:
Frantisek Sumsal 2023-02-22 20:43:52 +01:00 committed by Yu Watanabe
parent 58a80840e6
commit a90d9ee162

View 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"