summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@fedoraproject.org>2009-11-05 19:41:23 +0000
committerRay Strode <rstrode@fedoraproject.org>2009-11-05 19:41:23 +0000
commit0868f3bce70d65ba899ce765e7609c1b377cd3f2 (patch)
tree77fcdb9f25b50d96b0d0210259fc854210a5e6ed
parenta001892259117bea1f89d0699faa12f36b5243c3 (diff)
downloadmetacity-0868f3bce70d65ba899ce765e7609c1b377cd3f2.tar.gz
metacity-0868f3bce70d65ba899ce765e7609c1b377cd3f2.tar.xz
metacity-0868f3bce70d65ba899ce765e7609c1b377cd3f2.zip
Fix compiler warning breaking buildmetacity-2_28_0-7_fc12
-rw-r--r--metacity-dont-do-bad-stuff-on-sigterm.patch27
1 files changed, 17 insertions, 10 deletions
diff --git a/metacity-dont-do-bad-stuff-on-sigterm.patch b/metacity-dont-do-bad-stuff-on-sigterm.patch
index 4e9c061..6bdf166 100644
--- a/metacity-dont-do-bad-stuff-on-sigterm.patch
+++ b/metacity-dont-do-bad-stuff-on-sigterm.patch
@@ -1,6 +1,7 @@
-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
+diff --git a/src/core/main.c b/src/core/main.c
+index a36a396..5f21172 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
@@ -67,6 +67,7 @@
#include <fcntl.h>
#include <locale.h>
@@ -9,17 +10,21 @@ diff -up metacity-2.28.0/src/core/main.c.sigterm metacity-2.28.0/src/core/main.c
/**
* The exit code we'll return to our parent process when we eventually die.
-@@ -368,12 +369,18 @@ meta_finalize (void)
- meta_session_shutdown ();
+@@ -369,12 +370,22 @@ meta_finalize (void)
+ CurrentTime); /* I doubt correct timestamps matter here */
}
-+static int sigterm_pipe_fds[2];
++static int sigterm_pipe_fds[2] = { -1, -1 };
+
static void
sigterm_handler (int signum)
{
- meta_finalize ();
-+ close (sigterm_pipe_fds[1]);
++ if (sigterm_pipe_fds[1] >= 0)
++ {
++ close (sigterm_pipe_fds[1]);
++ sigterm_pipe_fds[1] = -1;
++ }
+}
- exit (meta_exit_code);
@@ -30,7 +35,7 @@ diff -up metacity-2.28.0/src/core/main.c.sigterm metacity-2.28.0/src/core/main.c
}
static guint sigchld_signal_id = 0;
-@@ -421,6 +428,7 @@ main (int argc, char **argv)
+@@ -422,6 +433,7 @@ main (int argc, char **argv)
"Pango", "GLib-GObject", "GThread"
};
guint i;
@@ -38,11 +43,13 @@ diff -up metacity-2.28.0/src/core/main.c.sigterm metacity-2.28.0/src/core/main.c
if (!g_thread_supported ())
g_thread_init (NULL);
-@@ -443,6 +451,14 @@ main (int argc, char **argv)
+@@ -444,6 +456,16 @@ main (int argc, char **argv)
g_strerror (errno));
#endif
-+ pipe (sigterm_pipe_fds);
++ if (pipe (sigterm_pipe_fds) != 0)
++ g_printerr ("Failed to create SIGTERM pipe: %s\n",
++ g_strerror (errno));
+
+ channel = g_io_channel_unix_new (sigterm_pipe_fds[0]);
+ g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);