diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-10-08 12:21:47 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-10-08 12:21:47 +0800 |
commit | 7f0542b1bb85724a84e33beb0c9902fc0b808a72 (patch) | |
tree | 719d3968968f8b9a8f936cec9b8b6ae1f7f77c7f /x11-wm/metacity/files | |
parent | edec989e3aeb2f20936a9af18040ec2d8870157c (diff) | |
download | marcuscom-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
Diffstat (limited to 'x11-wm/metacity/files')
-rw-r--r-- | x11-wm/metacity/files/patch-src_core_main.c | 51 |
1 files changed, 51 insertions, 0 deletions
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; |