summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErdal Ronahi <erdal.ronahi@gmail.com>2005-10-28 02:19:38 +0000
committerBrian Cameron <bcameron@src.gnome.org>2005-10-28 02:19:38 +0000
commita4063b36674ad8187e8c8c334455934dafbb1c8f (patch)
tree2a717377f4c45b2eb33b041d0676249bf4491411
parent2bd49fe98d3a2b456a13f082a1a2a1793aab7764 (diff)
downloadgdm-a4063b36674ad8187e8c8c334455934dafbb1c8f.tar.gz
Fix race condition where the d variable wasn't being set until after the
2005-10-27 Erdal Ronahi <erdal.ronahi@gmail.com> * daemon/slave.c: Fix race condition where the d variable wasn't being set until after the signal handlers, and the signal handlers make use of this variable. Now set it before to ensure it is set whenever a signal might be received. Issue pointed out by Simon Bowden on gdm-list@gnome.org
-rw-r--r--ChangeLog10
-rw-r--r--daemon/slave.c11
2 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fcdfe61..9a48ead2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2005-10-27 Erdal Ronahi <erdal.ronahi@gmail.com>
+ * daemon/slave.c: Fix race condition where the d
+ variable wasn't being set until after the signal
+ handlers, and the signal handlers make use of
+ this variable. Now set it before to ensure it
+ is set whenever a signal might be received.
+ Issue pointed out by Simon Bowden on
+ gdm-list@gnome.org
+
+2005-10-27 Erdal Ronahi <erdal.ronahi@gmail.com>
+
* configure.ac: Added ku (Kurdish) to ALL_LINGUAS
2005-10-26 Brian Cameron <Brian.Cameron@sun.com>
diff --git a/daemon/slave.c b/daemon/slave.c
index aef2b3fe..889bbb3f 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -88,7 +88,7 @@
#include "cookie.h"
/* Some per slave globals */
-static GdmDisplay *d;
+static GdmDisplay *d = 0;
static gchar *login = NULL;
static gboolean greet = FALSE;
static gboolean configurator = FALSE;
@@ -765,6 +765,13 @@ gdm_slave_start (GdmDisplay *display)
#endif /* SIGXFSZ */
sigset_t mask;
+ /*
+ * Set d global to display before setting signal handlers,
+ * since the signal handlers use the d value. Avoids a
+ * race condition.
+ */
+ d = display;
+
/* Ignore SIGUSR1/SIGPIPE, and especially ignore it
before the Setjmp */
gdm_signal_ignore (SIGUSR1);
@@ -1296,8 +1303,6 @@ gdm_slave_run (GdmDisplay *display)
gint openretries = 0;
gint maxtries = 0;
- d = display;
-
gdm_random_tick ();
if (d->sleep_before_run > 0) {