$OpenBSD: patch-src_goabackend_goalogging_c,v 1.2 2011/09/26 21:20:35 jasper Exp $

commit 080c1d09636020a72878372dcb5895e1286c8293
Author: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date:   Mon Sep 26 23:14:33 2011 +0200

    Kludge around lack of gettid(2) syscall on various systems.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660177

--- src/goabackend/goalogging.c.orig	Thu Aug 25 15:50:26 2011
+++ src/goabackend/goalogging.c	Mon Sep 26 23:16:09 2011
@@ -207,7 +207,12 @@ goa_log (GoaLogLevel     level,
       break;
     }
 
+ /* TODO: Need to find a portable way of getting the thread ID (#660177) */
+#ifdef SYS_gettid
   thread_str = g_strdup_printf ("%d", (gint) syscall (SYS_gettid));
+#else
+  thread_str = g_strdup_printf ("%d", (gint) getpid());
+#endif /* SYS_gettid */
   g_print ("%s%s%s.%03d:%s%s%s[%s]%s:%s%s%s:%s %s %s[%s, %s()]%s\n",
            _color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_YELLOW), time_buf, (gint) now.tv_usec / 1000, _color_get (_COLOR_RESET),
            _color_get (_COLOR_FG_MAGENTA), _color_get (_COLOR_BOLD_ON), thread_str, _color_get (_COLOR_RESET),
