From d527daa63bf346bf91b5a208e252ca738a57bd67 Mon Sep 17 00:00:00 2001 From: Siva Mahadevan Date: Tue, 17 Mar 2026 09:19:59 -0400 Subject: [PATCH] wp/log: only call gettid() on linux This is not implemented on other OSes such as the BSDs. --- lib/wp/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/wp/log.c b/lib/wp/log.c index 084f3ad5..9436d72b 100644 --- a/lib/wp/log.c +++ b/lib/wp/log.c @@ -777,7 +777,12 @@ wp_log_fields_write_to_journal (WpLogFields *lf) g_autofree gchar *full_message = NULL; const gchar *message = lf->message ? lf->message : ""; g_autofree gchar *pid = g_strdup_printf("%d", getpid()); - g_autofree gchar *tid = g_strdup_printf("%d", gettid()); +#ifdef __linux__ + pid_t tid_val = gettid(); +#else + pid_t tid_val = -1; +#endif + g_autofree gchar *tid = g_strdup_printf("%d", tid_val); #ifdef HAS_SHORT_NAME const gchar *syslog_identifier = program_invocation_short_name; #else