summaryrefslogtreecommitdiff
path: root/daemon/gdm-x-session.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-07-09 13:40:59 -0400
committerRay Strode <rstrode@redhat.com>2015-07-14 16:54:34 -0400
commit90a095e1a3ef26391da835ebe155deae26eeac5f (patch)
tree44dacd8ded78e8601c490a2b469467a4364c4529 /daemon/gdm-x-session.c
parent187180220ff6179419a2333c0cb1d57818f28854 (diff)
downloadgdm-90a095e1a3ef26391da835ebe155deae26eeac5f.tar.gz
gdm-x-session: kill subprocesses on sigterm
<dsd> Jasper: can you explain the logic bug? just curious <Jasper> dsd, GCancellable is a way of cancelling an ongoing operation. <Jasper> dsd, so we start up a wait_async, which says "call this callback when the subprocess exits". And then when we get a SIGTERM, we fire off the cancellable, saying "no no, don't actually wait for to finish, let's just cancel that now" <Jasper> dsd, the callback is called, but wait_finish returns FALSE, meaning that the wait was cancelled. And then the callback says "oh, cool, we're done here" and clears the x_session object. <Jasper> dsd, I'd have to inspect closer to determine a proper fix should we still cancel the wait but not actually clear the object, so we wait synchronously in cleanup?) <Jasper> Depends on what else uses the cancellable. <dsd> ahh <dsd> got it <Jasper> dsd, the other thing that should fix it would be moving the g_clear_object above the "out" label here: https://git.gnome.org/browse/gdm/tree/daemon/gdm-x-session.c?h=gnome-3-16#n185 <Jasper> And doing that for all of session / bus / x subprocesses. <Jasper> Maybe that's the cleaner fix. Based on a patch by João Paulo Rechi Vita <jprvita@endlessm.com> [endlessm/eos-shell#4921] https://bugzilla.gnome.org/show_bug.cgi?id=752388
Diffstat (limited to 'daemon/gdm-x-session.c')
-rw-r--r--daemon/gdm-x-session.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
index bcb884ce..f8eeb45c 100644
--- a/daemon/gdm-x-session.c
+++ b/daemon/gdm-x-session.c
@@ -183,8 +183,8 @@ on_x_server_finished (GSubprocess *subprocess,
g_debug ("X server was killed with status %d", signal_number);
}
-out:
g_clear_object (&state->x_subprocess);
+out:
g_main_loop_quit (state->main_loop);
}
@@ -352,8 +352,8 @@ on_bus_finished (GSubprocess *subprocess,
g_debug ("message bus was killed with status %d", signal_number);
}
-out:
g_clear_object (&state->bus_subprocess);
+out:
g_main_loop_quit (state->main_loop);
}
@@ -489,8 +489,8 @@ on_session_finished (GSubprocess *subprocess,
g_debug ("session was killed with status %d", signal_number);
}
-out:
g_clear_object (&state->session_subprocess);
+out:
g_main_loop_quit (state->main_loop);
}