[gdm] Only call backtrace() if execinfo.h exists
- From: Ray Strode <halfline src gnome org>
- To: svn-commits-list gnome org
- Subject: [gdm] Only call backtrace() if execinfo.h exists
- Date: Fri, 17 Jul 2009 03:05:11 +0000 (UTC)
commit 82b84fae0912c82cbef7d3b6bfedf934db8047b8
Author: Daniel Macks <dmacks netspace org>
Date: Thu Jul 16 23:04:21 2009 -0400
Only call backtrace() if execinfo.h exists
This fixes a build problem on OSX.
See http://bugzilla.gnome.org/show_bug.cgi?id=568491
common/gdm-signal-handler.c | 8 ++++++--
configure.ac | 6 ++++++
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/common/gdm-signal-handler.c b/common/gdm-signal-handler.c
index b9362b3..6b7b615 100644
--- a/common/gdm-signal-handler.c
+++ b/common/gdm-signal-handler.c
@@ -27,7 +27,9 @@
#include <unistd.h>
#include <string.h>
#include <signal.h>
+#if HAVE_EXECINFO_H
#include <execinfo.h>
+#endif
#include <syslog.h>
#include <sys/wait.h>
#include <sys/stat.h>
@@ -160,6 +162,7 @@ signal_io_watch (GIOChannel *ioc,
static void
fallback_get_backtrace (void)
{
+#ifdef HAVE_EXECINFO_H
void * frames[64];
size_t size;
char ** strings;
@@ -173,9 +176,10 @@ fallback_get_backtrace (void)
}
free (strings);
syslog (LOG_CRIT, "******************* END **********************************");
- } else {
- g_warning ("GDM crashed, but symbols couldn't be retrieved.");
+ return;
}
+#endif
+ g_warning ("GDM crashed, but symbols couldn't be retrieved.");
}
diff --git a/configure.ac b/configure.ac
index 22fff72..f8feddc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -899,6 +899,12 @@ AC_SUBST(RBAC_LIBS)
dnl ---------------------------------------------------------------------------
+dnl check for backtrace support
+dnl ---------------------------------------------------------------------------
+
+AC_CHECK_HEADERS(execinfo.h)
+
+dnl ---------------------------------------------------------------------------
dnl - Define some variables to represent the directories we use.
dnl ---------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]