summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@fedoraproject.org>2009-11-05 19:50:08 +0000
committerRay Strode <rstrode@fedoraproject.org>2009-11-05 19:50:08 +0000
commitf71bc361a2f7eed7501ec9387942334418ec446c (patch)
tree75f258ec05c0136748da5ec513bc038ca0309e66
parent0868f3bce70d65ba899ce765e7609c1b377cd3f2 (diff)
downloadmetacity-f71bc361a2f7eed7501ec9387942334418ec446c.tar.gz
metacity-f71bc361a2f7eed7501ec9387942334418ec446c.tar.xz
metacity-f71bc361a2f7eed7501ec9387942334418ec446c.zip
- Minor clean ups to last patch based on feedback from Owen
-rw-r--r--metacity-dont-do-bad-stuff-on-sigterm.patch26
-rw-r--r--metacity.spec6
2 files changed, 25 insertions, 7 deletions
diff --git a/metacity-dont-do-bad-stuff-on-sigterm.patch b/metacity-dont-do-bad-stuff-on-sigterm.patch
index 6bdf166..d4e690d 100644
--- a/metacity-dont-do-bad-stuff-on-sigterm.patch
+++ b/metacity-dont-do-bad-stuff-on-sigterm.patch
@@ -1,5 +1,16 @@
+From 591b6db8204864157f77e6c6cbaab0fa10416334 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Thu, 5 Nov 2009 14:47:47 -0500
+Subject: [PATCH] Don't call meta_finalize from SIGTERM handler
+
+It's not a legal function to call from a signal handler.
+Instead defer until going back to the main loop.
+---
+ src/core/main.c | 26 ++++++++++++++++++++++++--
+ 1 files changed, 24 insertions(+), 2 deletions(-)
+
diff --git a/src/core/main.c b/src/core/main.c
-index a36a396..5f21172 100644
+index a36a396..ab3b5f9 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -67,6 +67,7 @@
@@ -10,7 +21,7 @@ index a36a396..5f21172 100644
/**
* The exit code we'll return to our parent process when we eventually die.
-@@ -369,12 +370,22 @@ meta_finalize (void)
+@@ -369,12 +370,23 @@ meta_finalize (void)
CurrentTime); /* I doubt correct timestamps matter here */
}
@@ -28,14 +39,15 @@ index a36a396..5f21172 100644
+}
- exit (meta_exit_code);
-+static void
++static gboolean
+on_sigterm (void)
+{
+ meta_quit (0);
++ return FALSE;
}
static guint sigchld_signal_id = 0;
-@@ -422,6 +433,7 @@ main (int argc, char **argv)
+@@ -422,6 +434,7 @@ main (int argc, char **argv)
"Pango", "GLib-GObject", "GThread"
};
guint i;
@@ -43,7 +55,7 @@ index a36a396..5f21172 100644
if (!g_thread_supported ())
g_thread_init (NULL);
-@@ -444,6 +456,16 @@ main (int argc, char **argv)
+@@ -444,6 +457,15 @@ main (int argc, char **argv)
g_strerror (errno));
#endif
@@ -54,9 +66,11 @@ index a36a396..5f21172 100644
+ channel = g_io_channel_unix_new (sigterm_pipe_fds[0]);
+ g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);
+ g_io_add_watch (channel, G_IO_IN, (GIOFunc) on_sigterm, NULL);
-+ g_io_channel_set_close_on_unref (channel, TRUE);
+ g_io_channel_unref (channel);
+
act.sa_handler = &sigterm_handler;
if (sigaction (SIGTERM, &act, NULL) < 0)
g_printerr ("Failed to register SIGTERM handler: %s\n",
+--
+1.6.5.2
+
diff --git a/metacity.spec b/metacity.spec
index 82ed062..6f68a53 100644
--- a/metacity.spec
+++ b/metacity.spec
@@ -1,7 +1,7 @@
Summary: Unobtrusive window manager
Name: metacity
Version: 2.28.0
-Release: 7%{?dist}
+Release: 8%{?dist}
URL: http://download.gnome.org/sources/metacity/
Source0: http://download.gnome.org/sources/metacity/2.28/metacity-%{version}.tar.bz2
# http://bugzilla.gnome.org/show_bug.cgi?id=558723
@@ -199,6 +199,10 @@ fi
%{_mandir}/man1/metacity-window-demo.1.gz
%changelog
+* Thu Nov 05 2009 Ray Strode <rstrode@redhat.com> 2.28.0-8
+- Minor clean ups to last patch based on feedback from
+ Owen
+
* Thu Nov 05 2009 Ray Strode <rstrode@redhat.com> 2.28.0-7
- Don't do bad things on sigterm