[gnome-keyring/wip/fork-fixes: 2/3] daemon: kill off foreground proceses when session dies



commit 5573c2524d3115bb57afc9b7533a19fc930589a6
Author: Ray Strode <rstrode redhat com>
Date:   Thu Oct 15 16:07:22 2015 -0400

    daemon: kill off foreground proceses when session dies
    
    Right now gnome-keyring will keep processes around forever
    in some cases.  They need to die when the session goes away,
    at least.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756059

 daemon/gkd-main.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c
index 4925ee2..db32fa2 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -929,8 +929,16 @@ main (int argc, char *argv[])
                         * for any callers, and quit or go comatose.
                         */
                        send_environment_and_finish_parent (parent_wakeup_fd);
-                       if (run_foreground)
-                               while (sleep(0x08000000) == 0);
+                       if (run_foreground) {
+                               GDBusConnection *connection;
+                               connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
+                                                            NULL,
+                                                            NULL);
+                               loop = g_main_loop_new (NULL, FALSE);
+                               g_main_loop_run (loop);
+                               g_main_loop_unref (loop);
+                               loop = NULL;
+                       }
                        cleanup_and_exit (0);
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]