[gnome-online-accounts] Kludge around lack of gettid(2) syscall on various systems.
- From: Jasper Lievisse Adriaanse <jasperla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] Kludge around lack of gettid(2) syscall on various systems.
- Date: Mon, 26 Sep 2011 21:16:37 +0000 (UTC)
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 | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goalogging.c b/src/goabackend/goalogging.c
index 89657bf..2f39eb8 100644
--- a/src/goabackend/goalogging.c
+++ b/src/goabackend/goalogging.c
@@ -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),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]