From 580665d8c1975fdac74783630e805c323923fee4 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 24 May 2013 12:27:54 +0200 Subject: [PATCH 2/3] daemon: Check for monitor error immediately https://bugs.freedesktop.org/show_bug.cgi?id=63159 --- src/daemon.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/daemon.c b/src/daemon.c index e396aef..51e793e 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -760,20 +760,6 @@ daemon_init (Daemon *daemon) G_FILE_MONITOR_NONE, NULL, &error); - g_object_unref (file); - file = g_file_new_for_path (PATH_SHADOW); - daemon->priv->shadow_monitor = g_file_monitor_file (file, - G_FILE_MONITOR_NONE, - NULL, - &error); - g_object_unref (file); - file = g_file_new_for_path (PATH_GDM_CUSTOM); - daemon->priv->gdm_monitor = g_file_monitor_file (file, - G_FILE_MONITOR_NONE, - NULL, - &error); - g_object_unref (file); - if (daemon->priv->passwd_monitor != NULL) { g_signal_connect (daemon->priv->passwd_monitor, "changed", @@ -783,6 +769,13 @@ daemon_init (Daemon *daemon) g_warning ("Unable to monitor %s: %s", PATH_PASSWD, error->message); g_error_free (error); } + g_object_unref (file); + + file = g_file_new_for_path (PATH_SHADOW); + daemon->priv->shadow_monitor = g_file_monitor_file (file, + G_FILE_MONITOR_NONE, + NULL, + &error); if (daemon->priv->shadow_monitor != NULL) { g_signal_connect (daemon->priv->shadow_monitor, "changed", @@ -791,7 +784,14 @@ daemon_init (Daemon *daemon) } else { g_warning ("Unable to monitor %s: %s", PATH_SHADOW, error->message); g_error_free (error); - } + } + g_object_unref (file); + + file = g_file_new_for_path (PATH_GDM_CUSTOM); + daemon->priv->gdm_monitor = g_file_monitor_file (file, + G_FILE_MONITOR_NONE, + NULL, + &error); if (daemon->priv->gdm_monitor != NULL) { g_signal_connect (daemon->priv->gdm_monitor, "changed", @@ -801,6 +801,7 @@ daemon_init (Daemon *daemon) g_warning ("Unable to monitor %s: %s", PATH_GDM_CUSTOM, error->message); g_error_free (error); } + g_object_unref (file); queue_reload_users (daemon); queue_reload_autologin (daemon); -- 1.8.1.4