diff src/aim.c @ 1415:3dfd2a83fb5e

[gaim-migrate @ 1425] woo hoo committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 19 Jan 2001 09:11:16 +0000
parents 17e544f8c7fb
children b4de935f820f
line wrap: on
line diff
--- a/src/aim.c	Fri Jan 19 03:19:46 2001 +0000
+++ b/src/aim.c	Fri Jan 19 09:11:16 2001 +0000
@@ -387,8 +387,25 @@
 #if HAVE_SIGNAL_H
 void sighandler(int sig)
 {
-	fprintf(stderr, "God damn, I tripped.\n");
-	exit(11);		/* signal 11 */
+	debug_printf("caught signal %d\n", sig);
+	gtkspell_stop();
+	switch (sig) {
+	case SIGSEGV:
+		g_print("Gaim has segfaulted and attempted to dump a core file.\n"
+			"Please notify the gaim maintainers by reporting a bug at\n"
+			"http://sourceforge.net/projects/gaim/\n\n"
+			"Please make sure to specify what you were doing at the time,\n"
+			"and post the backtrace from the core file (if you do not know\n"
+			"how to get the backtrace, please IM either EWarmenhoven or\n"
+			"RobFlynn and they can instruct you).\n");
+		abort();
+		break;
+	case SIGPIPE:
+		/* should we do something here? */
+	default:
+		gtk_main_quit();
+		exit(0);
+	}
 }
 #endif
 
@@ -433,7 +450,10 @@
 
 #if HAVE_SIGNAL_H
 	/* Let's not violate any PLA's!!!! */
-	/* signal(SIGSEGV, sighandler); */
+	signal(SIGSEGV, sighandler);
+	signal(SIGHUP, sighandler);
+	signal(SIGINT, sighandler);
+	signal(SIGPIPE, sighandler);
 #endif