changeset 614:a3e32af35b30

[gaim-migrate @ 624] catch sigsegv :) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 05 Aug 2000 02:26:39 +0000
parents 7800445cc561
children 9f168ba28ac2
files configure.in src/aim.c
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sat Aug 05 01:56:47 2000 +0000
+++ b/configure.in	Sat Aug 05 02:26:39 2000 +0000
@@ -17,7 +17,7 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h)
+AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h signal.h)
 AC_CHECK_HEADERS(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not found ***]))
 
 dnl Checks for typedefs, structures, and compiler characteristics.
--- a/src/aim.c	Sat Aug 05 01:56:47 2000 +0000
+++ b/src/aim.c	Sat Aug 05 02:26:39 2000 +0000
@@ -49,6 +49,9 @@
 #ifndef USE_APPLET
 #include "pixmaps/logo.xpm"
 #endif /* USE_APPLET */
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
 #include "locale.h"
 #include "gtkticker.h"
 
@@ -527,6 +530,14 @@
 
 extern void show_debug(GtkObject *);
 
+#if HAVE_SIGNAL_H
+void sighandler(int sig)
+{
+	fprintf(stderr, "God damn, I tripped.\n");
+	exit(11); /* signal 11 */
+}
+#endif
+
 int main(int argc, char *argv[])
 {
 #ifdef ENABLE_NLS
@@ -534,6 +545,11 @@
 	textdomain(PACKAGE);
 #endif
 
+#if HAVE_SIGNAL_H
+	/* Let's not violate any PLA's!!!! */
+	signal(SIGSEGV, sighandler);
+#endif
+
 	if (argc > 1 && !strcmp(argv[1], "--version")) {
 		gtk_init(&argc, &argv);
 		set_defaults(); /* needed for open_url_nw */