summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2006-05-04 22:50:53 +0000
committerBrian Cameron <bcameron@src.gnome.org>2006-05-04 22:50:53 +0000
commitf63a40c4039372cbb6342d86ae9041ed7be8ce38 (patch)
tree0ceff52e2a3d48066bdf1f752c7ed1e6c74acb0d
parent6fa9b225b81a51ff8c88e79fc5a769cc0683b521 (diff)
downloadgdm-f63a40c4039372cbb6342d86ae9041ed7be8ce38.tar.gz
Improvements to signal handling, fixing problem where GDM slave can hang
2006-05-04 Brian Cameron <brian.cameron@sun.com> * daemon/display.c, daemon/slave.c, daemon/misc.c: Improvements to signal handling, fixing problem where GDM slave can hang on read. Fixes bug #336549. Patch provided by Ed Catmur <ed@catmur.co.uk>. * AUTHORS: Added Ed.
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog7
-rw-r--r--daemon/display.c2
-rw-r--r--daemon/misc.c20
-rw-r--r--daemon/slave.c2
5 files changed, 25 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index cf9af351..0bb7877a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -37,6 +37,7 @@ Contributions from:
Dean Scott <drscott12@hotmail.com>
Diego Gonzalez <diego@pemas.net>
Dominique Hazael-Massieux <dominique.hazael-massieux@centraliens.net>
+ Ed Catmur <ed@catmur.co.uk>
Elliot Lee <sopwith@redhat.com>
Federico Mena Quintero <federico@nuclecu.unam.mx>
Fernando Herrera <fherrera@onirica.com>
diff --git a/ChangeLog b/ChangeLog
index 6bc8ae94..c21505a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-05-04 Brian Cameron <brian.cameron@sun.com>
+ * daemon/display.c, daemon/slave.c, daemon/misc.c: Improvements to
+ signal handling, fixing problem where GDM slave can hang on read.
+ Fixes bug #336549. Patch provided by Ed Catmur <ed@catmur.co.uk>.
+ * AUTHORS: Added Ed.
+
+2006-05-04 Brian Cameron <brian.cameron@sun.com>
+
* configure.ac: Fix invokation of PreFetch list.
2006-05-04 Brian Cameron <brian.cameron@sun.com>
diff --git a/daemon/display.c b/daemon/display.c
index 8cf6596d..56263ff8 100644
--- a/daemon/display.c
+++ b/daemon/display.c
@@ -317,6 +317,8 @@ gdm_display_manage (GdmDisplay *d)
d->slave_notify_fd = fds[0];
+ fcntl (d->slave_notify_fd, F_SETFL, fcntl (d->slave_notify_fd, F_GETFL) | O_NONBLOCK);
+
gdm_slave_start (d);
/* should never retern */
diff --git a/daemon/misc.c b/daemon/misc.c
index 193afad0..d17c10ee 100644
--- a/daemon/misc.c
+++ b/daemon/misc.c
@@ -889,24 +889,32 @@ gdm_sigterm_block_pop (void)
void
gdm_sigusr2_block_push (void)
{
- sigusr2_blocked++;
+ sigset_t oldmask;
- if (sigusr2_blocked == 1) {
+ if (sigusr2_blocked == 0) {
/* Set signal mask */
sigemptyset (&sigusr2block_mask);
sigaddset (&sigusr2block_mask, SIGUSR2);
- sigprocmask (SIG_BLOCK, &sigusr2block_mask, &sigusr2block_oldmask);
+ sigprocmask (SIG_BLOCK, &sigusr2block_mask, &oldmask);
}
+
+ sigusr2_blocked++;
+
+ sigusr2_block_oldmask = oldmask;
}
void
gdm_sigusr2_block_pop (void)
{
- sigusr2_blocked --;
+ sigset_t oldmask;
+
+ oldmask = sigusr2block_oldmask;
+
+ sigusr2_blocked--;
if (sigusr2_blocked == 0) {
- /* Reset signal mask back */
- sigprocmask (SIG_SETMASK, &sigusr2block_oldmask, NULL);
+ /* Reset signal mask back */
+ sigprocmask (SIG_SETMASK, &sigusr2block_oldmask, NULL);
}
}
diff --git a/daemon/slave.c b/daemon/slave.c
index 310c5554..292d0e86 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -4759,7 +4759,7 @@ static void
gdm_slave_handle_usr2_message (void)
{
char buf[256];
- size_t count;
+ ssize_t count;
char **vec;
int i;