mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 12:00:11 +01:00
shared/systemd: fix gettid() compat implementation shadowing function from glibc
On Fedora rawhide we get the following build failure:
In file included from shared/systemd/src/basic/alloc-util.c:3:
./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:114:21: error: static declaration of 'gettid' follows non-static declaration
114 | static inline pid_t gettid(void) {
| ^~~~~~
In file included from /usr/include/unistd.h:1170,
from /usr/include/glib-2.0/gio/gcredentials.h:32,
from /usr/include/glib-2.0/gio/gio.h:46,
from ./shared/nm-utils/nm-macros-internal.h:31,
from ./shared/nm-default.h:293,
from ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:22,
from shared/systemd/src/basic/alloc-util.c:3:
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
34 | extern __pid_t gettid (void) __THROW;
| ^~~~~~
glibc supports now gettid() call ([1]) which conflicts with our compat
implementation. Rename it.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92
(cherry picked from commit 10276322bd)
(cherry picked from commit cfb970b277)
(cherry picked from commit d160b7b990)
(cherry picked from commit b10a7e5786)
(cherry picked from commit 4ae20ea80a)
(cherry picked from commit d943b538cf)
(cherry picked from commit b3332f6df6)
(cherry picked from commit a03d784610)
This commit is contained in:
parent
bbc13c5bb6
commit
24b8a4bc75
1 changed files with 2 additions and 1 deletions
|
|
@ -163,9 +163,10 @@ sd_notify (int unset_environment, const char *state)
|
|||
#include "async.h"
|
||||
#include "util.h"
|
||||
|
||||
static inline pid_t gettid(void) {
|
||||
static inline pid_t _nm_gettid(void) {
|
||||
return (pid_t) syscall(SYS_gettid);
|
||||
}
|
||||
#define gettid() _nm_gettid ()
|
||||
|
||||
static inline bool is_main_thread(void) {
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue