diff options
author | Ondrej Holy <oholy@redhat.com> | 2013-05-24 12:27:54 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-06-05 20:25:31 -0400 |
commit | af67e3c58a67784d6e8b4b0e45f450fb69161ab9 (patch) | |
tree | 3e64c8c2d9428d1b52097f4de979e14dde6d89d7 | |
parent | 9660e0b1ca7e304108729ec9e268c1d71949a55e (diff) |
daemon: Check for monitor error immediately
https://bugs.freedesktop.org/show_bug.cgi?id=63159
-rw-r--r-- | src/daemon.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/daemon.c b/src/daemon.c index 997d681..2ead987 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -762,20 +762,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", @@ -785,6 +771,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", @@ -793,7 +786,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", @@ -803,6 +803,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); |