[gnome-session/wip/fix-autostart-critical: 2/2] autostart-app: don't try to add child watch to dbus activated services



commit b5f62e99fc322ee2ca8f41f233706045640d8f51
Author: Ray Strode <rstrode redhat com>
Date:   Wed Jun 5 11:02:45 2019 -0400

    autostart-app: don't try to add child watch to dbus activated services
    
    If a service is dbus activated, then gnome-session isn't starting it
    directly and it makes no sense to try to create a child watch on it.
    
    This commit ensures, child watches are only set up on apps that are
    started directly by gnome-session, which avoids generating a critical
    message in the log for each dbus activated app.
    
    https://gitlab.gnome.org/GNOME/gnome-session/issues/14

 gnome-session/gsm-autostart-app.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 2332b039..57f04a6f 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -1032,10 +1032,11 @@ autostart_app_start_spawn (GsmAutostartApp *app,
         g_signal_handler_disconnect (ctx, handler);
 
         if (success) {
-                g_debug ("GsmAutostartApp: started pid:%d", app->priv->pid);
-                app->priv->child_watch_id = g_child_watch_add (app->priv->pid,
-                                                               (GChildWatchFunc)app_exited,
-                                                               app);
+                if (app->priv->pid > 0)
+                        g_debug ("GsmAutostartApp: started pid:%d", app->priv->pid);
+                        app->priv->child_watch_id = g_child_watch_add (app->priv->pid,
+                                                                       (GChildWatchFunc)app_exited,
+                                                                       app);
         } else {
                 g_set_error (error,
                              GSM_APP_ERROR,


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