summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-10-08 12:21:47 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-10-08 12:21:47 +0800
commit7f0542b1bb85724a84e33beb0c9902fc0b808a72 (patch)
tree719d3968968f8b9a8f936cec9b8b6ae1f7f77c7f
parentedec989e3aeb2f20936a9af18040ec2d8870157c (diff)
downloadmarcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar.gz
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar.bz2
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar.lz
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar.xz
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.tar.zst
marcuscom-ports-7f0542b1bb85724a84e33beb0c9902fc0b808a72.zip
Install a SIGTERM handler to prevent metacity from restarting when it is
killed. This should prevent crashes when logging in from gdm. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@11669 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--x11-wm/metacity/Makefile3
-rw-r--r--x11-wm/metacity/files/patch-src_core_main.c51
2 files changed, 53 insertions, 1 deletions
diff --git a/x11-wm/metacity/Makefile b/x11-wm/metacity/Makefile
index 7dbdc6f8e..527fcd7d8 100644
--- a/x11-wm/metacity/Makefile
+++ b/x11-wm/metacity/Makefile
@@ -3,11 +3,12 @@
# Whom: Garrett Rooney <rooneg@electricjellyfish.net>
#
# $FreeBSD$
-# $MCom: ports/x11-wm/metacity/Makefile,v 1.138 2008/09/09 19:15:19 marcus Exp $
+# $MCom: ports/x11-wm/metacity/Makefile,v 1.139 2008/09/23 05:00:56 marcus Exp $
#
PORTNAME= metacity
PORTVERSION= 2.24.0
+PORTREVISION= 1
CATEGORIES= x11-wm
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
diff --git a/x11-wm/metacity/files/patch-src_core_main.c b/x11-wm/metacity/files/patch-src_core_main.c
new file mode 100644
index 000000000..db73c224f
--- /dev/null
+++ b/x11-wm/metacity/files/patch-src_core_main.c
@@ -0,0 +1,51 @@
+--- src/core/main.c.orig 2008-10-08 00:10:39.000000000 -0400
++++ src/core/main.c 2008-10-08 00:18:44.000000000 -0400
+@@ -312,6 +312,23 @@ void meta_select_display (gchar *display
+ /* DO NOT FREE envVar, putenv() sucks */
+ putenv (envVar);
+ }
++
++static
++void meta_finalize (void)
++{
++ meta_display_close (meta_get_display (),
++ CurrentTime); /* I doubt correct timestamps matter here */
++
++ meta_session_shutdown ();
++}
++
++static
++void sigterm_handler (int signum)
++{
++ meta_finalize ();
++
++ exit (meta_exit_code);
++}
+
+ /**
+ * This is where the story begins. It parses commandline options and
+@@ -352,6 +369,11 @@ main (int argc, char **argv)
+ g_strerror (errno));
+ #endif
+
++ act.sa_handler = &sigterm_handler;
++ if (sigaction (SIGTERM, &act, NULL) < 0)
++ g_printerr ("Failed to register SIGTERM handler: %s\n",
++ g_strerror (errno));
++
+ if (g_getenv ("METACITY_VERBOSE"))
+ meta_set_verbose (TRUE);
+ if (g_getenv ("METACITY_DEBUG"))
+@@ -478,11 +500,8 @@ main (int argc, char **argv)
+
+ g_main_loop_run (meta_main_loop);
+
+- meta_display_close (meta_get_display (),
+- CurrentTime); /* I doubt correct timestamps matter here */
++ meta_finalize ();
+
+- meta_session_shutdown ();
+-
+ if (meta_restart_after_quit)
+ {
+ GError *err;