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



commit 670cd0441609470c4b3cdf9d95c60620e4a00d70
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 7a8972c..095daf0 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -955,8 +955,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]