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:
Thomas Haller 2021-07-08 08:24:09 +02:00
parent e874c5bf6b
commit 0c4a65929c
No known key found for this signature in database
GPG Key ID: 29C2366E4DFC5728
5 changed files with 7 additions and 11 deletions

View File

@ -4436,7 +4436,9 @@ src_core_tests_test_systemd_LDFLAGS = \
src_core_tests_test_systemd_LDADD = \
src/libnm-systemd-core/libnm-systemd-core.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-std-aux/libnm-std-aux.la \
src/c-siphash/libc-siphash.la \
$(GLIB_LIBS) \
$(CODE_COVERAGE_LDFLAGS) \

View File

@ -44,7 +44,9 @@ exe = executable(
link_with: [
libnm_systemd_shared,
libnm_systemd_core,
libnm_glib_aux,
libnm_log_null,
libnm_std_aux,
libc_siphash,
],
)

View File

@ -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++] = _pid_hash(getpid());
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);
}

View File

@ -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);
gboolean _nm_assert_on_main_thread(void);

View File

@ -75,6 +75,8 @@ raw_getpid(void)
#endif
}
#define gettid() nm_utils_gettid()
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
#define HAVE_CHAR32_T 1
#define HAVE_CHAR16_T 1