diff options
author | Ray Strode <rstrode@fedoraproject.org> | 2009-11-05 19:33:25 +0000 |
---|---|---|
committer | Ray Strode <rstrode@fedoraproject.org> | 2009-11-05 19:33:25 +0000 |
commit | a001892259117bea1f89d0699faa12f36b5243c3 (patch) | |
tree | 1ea8745737a35a7ea3d360dd99b9a4a9324a4b56 | |
parent | 33deb5ab1d41ff81d0cabf7d0980df9ed7c61c5d (diff) | |
download | metacity-a001892259117bea1f89d0699faa12f36b5243c3.tar.gz metacity-a001892259117bea1f89d0699faa12f36b5243c3.tar.xz metacity-a001892259117bea1f89d0699faa12f36b5243c3.zip |
- Don't do bad things on sigterm
-rw-r--r-- | metacity-dont-do-bad-stuff-on-sigterm.patch | 55 | ||||
-rw-r--r-- | metacity.spec | 10 |
2 files changed, 64 insertions, 1 deletions
diff --git a/metacity-dont-do-bad-stuff-on-sigterm.patch b/metacity-dont-do-bad-stuff-on-sigterm.patch new file mode 100644 index 0000000..4e9c061 --- /dev/null +++ b/metacity-dont-do-bad-stuff-on-sigterm.patch @@ -0,0 +1,55 @@ +diff -up metacity-2.28.0/src/core/main.c.sigterm metacity-2.28.0/src/core/main.c +--- metacity-2.28.0/src/core/main.c.sigterm 2009-11-05 14:25:53.792237514 -0500 ++++ metacity-2.28.0/src/core/main.c 2009-11-05 14:30:51.732486909 -0500 +@@ -67,6 +67,7 @@ + #include <fcntl.h> + #include <locale.h> + #include <time.h> ++#include <unistd.h> + + /** + * The exit code we'll return to our parent process when we eventually die. +@@ -368,12 +369,18 @@ meta_finalize (void) + meta_session_shutdown (); + } + ++static int sigterm_pipe_fds[2]; ++ + static void + sigterm_handler (int signum) + { +- meta_finalize (); ++ close (sigterm_pipe_fds[1]); ++} + +- exit (meta_exit_code); ++static void ++on_sigterm (void) ++{ ++ meta_quit (0); + } + + static guint sigchld_signal_id = 0; +@@ -421,6 +428,7 @@ main (int argc, char **argv) + "Pango", "GLib-GObject", "GThread" + }; + guint i; ++ GIOChannel *channel; + + if (!g_thread_supported ()) + g_thread_init (NULL); +@@ -443,6 +451,14 @@ main (int argc, char **argv) + g_strerror (errno)); + #endif + ++ pipe (sigterm_pipe_fds); ++ ++ 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", diff --git a/metacity.spec b/metacity.spec index 8489bfd..82ed062 100644 --- a/metacity.spec +++ b/metacity.spec @@ -1,7 +1,7 @@ Summary: Unobtrusive window manager Name: metacity Version: 2.28.0 -Release: 6%{?dist} +Release: 7%{?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 @@ -21,6 +21,10 @@ Patch9: 0001-tooltip-set-window-type-hint-for-self-drawn-tooltips.patch Patch10: workspaces.patch Patch11: fresh-tooltips.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=600864 +# https://bugzilla.redhat.com/show_bug.cgi?id=533239 +Patch12: metacity-dont-do-bad-stuff-on-sigterm.patch + License: GPLv2+ Group: User Interface/Desktops BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -87,6 +91,7 @@ API. This package exists purely for technical reasons. %patch9 -p1 -b .tooltip %patch10 -p1 -b .workspaces %patch11 -p1 -b .fresh-tooltips +%patch12 -p1 -b .sigterm # force regeneration rm src/metacity.schemas @@ -194,6 +199,9 @@ fi %{_mandir}/man1/metacity-window-demo.1.gz %changelog +* Thu Nov 05 2009 Ray Strode <rstrode@redhat.com> 2.28.0-7 +- Don't do bad things on sigterm + * Wed Oct 28 2009 Matthias Clasen <mclasen@redhat.cm> - 2.28.0-6 - Make tooltips look sharper |