mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 10:46:59 +00:00
glib-aux: use nm_utils_gettid() instead of gettid()
I missed that we already have a gettid() wrapper. Drop the duplicated
again and use nm_utils_gettid().
Fixes: e874c5bf6b
('random: Provide missing gettid() declaration')
This commit is contained in:
parent
e874c5bf6b
commit
0c4a65929c
|
@ -4436,7 +4436,9 @@ src_core_tests_test_systemd_LDFLAGS = \
|
||||||
src_core_tests_test_systemd_LDADD = \
|
src_core_tests_test_systemd_LDADD = \
|
||||||
src/libnm-systemd-core/libnm-systemd-core.la \
|
src/libnm-systemd-core/libnm-systemd-core.la \
|
||||||
src/libnm-systemd-shared/libnm-systemd-shared.la \
|
src/libnm-systemd-shared/libnm-systemd-shared.la \
|
||||||
|
src/libnm-glib-aux/libnm-glib-aux.la \
|
||||||
src/libnm-log-null/libnm-log-null.la \
|
src/libnm-log-null/libnm-log-null.la \
|
||||||
|
src/libnm-std-aux/libnm-std-aux.la \
|
||||||
src/c-siphash/libc-siphash.la \
|
src/c-siphash/libc-siphash.la \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
$(CODE_COVERAGE_LDFLAGS) \
|
$(CODE_COVERAGE_LDFLAGS) \
|
||||||
|
|
|
@ -44,7 +44,9 @@ exe = executable(
|
||||||
link_with: [
|
link_with: [
|
||||||
libnm_systemd_shared,
|
libnm_systemd_shared,
|
||||||
libnm_systemd_core,
|
libnm_systemd_core,
|
||||||
|
libnm_glib_aux,
|
||||||
libnm_log_null,
|
libnm_log_null,
|
||||||
|
libnm_std_aux,
|
||||||
libc_siphash,
|
libc_siphash,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,7 +61,7 @@ _rand_init_seed(guint32 seed_array[static SEED_ARRAY_SIZE], GRand *rand)
|
||||||
seed_array[seed_idx++] = ((guint64) now_nsec);
|
seed_array[seed_idx++] = ((guint64) now_nsec);
|
||||||
seed_array[seed_idx++] = _pid_hash(getpid());
|
seed_array[seed_idx++] = _pid_hash(getpid());
|
||||||
seed_array[seed_idx++] = _pid_hash(getppid());
|
seed_array[seed_idx++] = _pid_hash(getppid());
|
||||||
seed_array[seed_idx++] = _pid_hash(gettid());
|
seed_array[seed_idx++] = _pid_hash(nm_utils_gettid());
|
||||||
|
|
||||||
nm_assert(seed_idx == SEED_ARRAY_SIZE);
|
nm_assert(seed_idx == SEED_ARRAY_SIZE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,16 +30,6 @@ nm_is_ascii(char ch)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
static inline pid_t
|
|
||||||
_nm_gettid(void)
|
|
||||||
{
|
|
||||||
return (pid_t) syscall(SYS_gettid);
|
|
||||||
}
|
|
||||||
#define gettid() _nm_gettid()
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
pid_t nm_utils_gettid(void);
|
pid_t nm_utils_gettid(void);
|
||||||
|
|
||||||
gboolean _nm_assert_on_main_thread(void);
|
gboolean _nm_assert_on_main_thread(void);
|
||||||
|
|
|
@ -75,6 +75,8 @@ raw_getpid(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define gettid() nm_utils_gettid()
|
||||||
|
|
||||||
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
|
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
|
||||||
#define HAVE_CHAR32_T 1
|
#define HAVE_CHAR32_T 1
|
||||||
#define HAVE_CHAR16_T 1
|
#define HAVE_CHAR16_T 1
|
||||||
|
|
Loading…
Reference in a new issue