gdm r6382 - in trunk: . common daemon
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6382 - in trunk: . common daemon
- Date: Fri, 15 Aug 2008 17:13:37 +0000 (UTC)
Author: mccann
Date: Fri Aug 15 17:13:36 2008
New Revision: 6382
URL: http://svn.gnome.org/viewvc/gdm?rev=6382&view=rev
Log:
2008-08-15 William Jon McCann <jmccann redhat com>
* common/gdm-signal-handler.c (signal_io_watch),
(gdm_signal_handler_set_fatal_func):
* common/gdm-signal-handler.h:
* daemon/factory-slave-main.c (main):
* daemon/gdm-session-direct.c (stop_worker):
* daemon/gdm-session-worker-job.c (session_worker_job_child_watch):
* daemon/main.c (main):
* daemon/product-slave-main.c (main):
* daemon/session-worker-main.c (main):
* daemon/simple-slave-main.c (main):
* daemon/xdmcp-chooser-slave-main.c (main):
Use a callback for the fatal handler instead of supplying
the main_loop.
Modified:
trunk/ChangeLog
trunk/common/gdm-signal-handler.c
trunk/common/gdm-signal-handler.h
trunk/daemon/factory-slave-main.c
trunk/daemon/gdm-session-direct.c
trunk/daemon/gdm-session-worker-job.c
trunk/daemon/main.c
trunk/daemon/product-slave-main.c
trunk/daemon/session-worker-main.c
trunk/daemon/simple-slave-main.c
trunk/daemon/xdmcp-chooser-slave-main.c
Modified: trunk/common/gdm-signal-handler.c
==============================================================================
--- trunk/common/gdm-signal-handler.c (original)
+++ trunk/common/gdm-signal-handler.c Fri Aug 15 17:13:36 2008
@@ -50,11 +50,12 @@
struct GdmSignalHandlerPrivate
{
- GMainLoop *main_loop;
- GHashTable *lookup;
- GHashTable *id_lookup;
- GHashTable *action_lookup;
- guint next_id;
+ GHashTable *lookup;
+ GHashTable *id_lookup;
+ GHashTable *action_lookup;
+ guint next_id;
+ GDestroyNotify fatal_func;
+ gpointer fatal_data;
};
static void gdm_signal_handler_class_init (GdmSignalHandlerClass *klass);
@@ -140,10 +141,11 @@
block_signals_pop ();
if (is_fatal) {
- g_debug ("GdmSignalHandler: Caught termination signal - exiting main loop");
- if (handler->priv->main_loop != NULL) {
- g_main_loop_quit (handler->priv->main_loop);
+ if (handler->priv->fatal_func != NULL) {
+ g_debug ("GdmSignalHandler: Caught termination signal - calling fatal func");
+ handler->priv->fatal_func (handler->priv->fatal_data);
} else {
+ g_debug ("GdmSignalHandler: Caught termination signal - exiting");
exit (1);
}
@@ -456,13 +458,14 @@
}
void
-gdm_signal_handler_set_main_loop (GdmSignalHandler *handler,
- GMainLoop *main_loop)
+gdm_signal_handler_set_fatal_func (GdmSignalHandler *handler,
+ GDestroyNotify func,
+ gpointer user_data)
{
g_return_if_fail (GDM_IS_SIGNAL_HANDLER (handler));
- /* FIXME: take a ref */
- handler->priv->main_loop = main_loop;
+ handler->priv->fatal_func = func;
+ handler->priv->fatal_data = user_data;
}
static void
Modified: trunk/common/gdm-signal-handler.h
==============================================================================
--- trunk/common/gdm-signal-handler.h (original)
+++ trunk/common/gdm-signal-handler.h Fri Aug 15 17:13:36 2008
@@ -53,8 +53,9 @@
GType gdm_signal_handler_get_type (void);
GdmSignalHandler * gdm_signal_handler_new (void);
-void gdm_signal_handler_set_main_loop (GdmSignalHandler *handler,
- GMainLoop *main_loop);
+void gdm_signal_handler_set_fatal_func (GdmSignalHandler *handler,
+ GDestroyNotify func,
+ gpointer user_data);
void gdm_signal_handler_add_fatal (GdmSignalHandler *handler);
guint gdm_signal_handler_add (GdmSignalHandler *handler,
Modified: trunk/daemon/factory-slave-main.c
==============================================================================
--- trunk/daemon/factory-slave-main.c (original)
+++ trunk/daemon/factory-slave-main.c Fri Aug 15 17:13:36 2008
@@ -203,7 +203,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
Modified: trunk/daemon/gdm-session-direct.c
==============================================================================
--- trunk/daemon/gdm-session-direct.c (original)
+++ trunk/daemon/gdm-session-direct.c Fri Aug 15 17:13:36 2008
@@ -1629,6 +1629,19 @@
static void
stop_worker (GdmSessionDirect *session)
{
+ g_signal_handlers_disconnect_by_func (session->priv->job,
+ G_CALLBACK (worker_stopped),
+ session);
+ g_signal_handlers_disconnect_by_func (session->priv->job,
+ G_CALLBACK (worker_started),
+ session);
+ g_signal_handlers_disconnect_by_func (session->priv->job,
+ G_CALLBACK (worker_exited),
+ session);
+ g_signal_handlers_disconnect_by_func (session->priv->job,
+ G_CALLBACK (worker_died),
+ session);
+
cancel_pending_query (session);
if (session->priv->worker_connection != NULL) {
@@ -1637,6 +1650,7 @@
}
gdm_session_worker_job_stop (session->priv->job);
+ g_object_unref (session->priv->job);
session->priv->job = NULL;
}
Modified: trunk/daemon/gdm-session-worker-job.c
==============================================================================
--- trunk/daemon/gdm-session-worker-job.c (original)
+++ trunk/daemon/gdm-session-worker-job.c Fri Aug 15 17:13:36 2008
@@ -100,6 +100,10 @@
WIFEXITED (status) ? WEXITSTATUS (status)
: WIFSIGNALED (status) ? WTERMSIG (status)
: -1);
+
+ g_spawn_close_pid (job->priv->pid);
+ job->priv->pid = -1;
+
if (WIFEXITED (status)) {
int code = WEXITSTATUS (status);
g_signal_emit (job, signals [EXITED], 0, code);
@@ -107,9 +111,6 @@
int num = WTERMSIG (status);
g_signal_emit (job, signals [DIED], 0, num);
}
-
- g_spawn_close_pid (job->priv->pid);
- job->priv->pid = -1;
}
static void
Modified: trunk/daemon/main.c
==============================================================================
--- trunk/daemon/main.c (original)
+++ trunk/daemon/main.c Fri Aug 15 17:13:36 2008
@@ -620,7 +620,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add_fatal (signal_handler);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
Modified: trunk/daemon/product-slave-main.c
==============================================================================
--- trunk/daemon/product-slave-main.c (original)
+++ trunk/daemon/product-slave-main.c Fri Aug 15 17:13:36 2008
@@ -207,7 +207,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
Modified: trunk/daemon/session-worker-main.c
==============================================================================
--- trunk/daemon/session-worker-main.c (original)
+++ trunk/daemon/session-worker-main.c Fri Aug 15 17:13:36 2008
@@ -166,7 +166,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
Modified: trunk/daemon/simple-slave-main.c
==============================================================================
--- trunk/daemon/simple-slave-main.c (original)
+++ trunk/daemon/simple-slave-main.c Fri Aug 15 17:13:36 2008
@@ -217,7 +217,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
Modified: trunk/daemon/xdmcp-chooser-slave-main.c
==============================================================================
--- trunk/daemon/xdmcp-chooser-slave-main.c (original)
+++ trunk/daemon/xdmcp-chooser-slave-main.c Fri Aug 15 17:13:36 2008
@@ -209,7 +209,9 @@
main_loop = g_main_loop_new (NULL, FALSE);
signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_set_fatal_func (signal_handler,
+ (GDestroyNotify)g_main_loop_quit,
+ main_loop);
gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]