[gdm/multi-stack-async-stop: 35/37] Store name of worker job after starting it



commit ffdb44356dcfc8b88c6daa471398d2c634161783
Author: Ray Strode <rstrode redhat com>
Date:   Thu Apr 23 11:24:09 2009 -0400

    Store name of worker job after starting it
    
    This makes it easier to print debug messages.

 daemon/gdm-session-worker-job.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index 0327d77..01ca4ea 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -54,6 +54,7 @@ extern char **environ;
 struct GdmSessionWorkerJobPrivate
 {
         char           *command;
+        char           *name;
         GPid            pid;
 
         guint           child_watch_id;
@@ -91,7 +92,8 @@ session_worker_job_child_watch (GPid                 pid,
                                 int                  status,
                                 GdmSessionWorkerJob *job)
 {
-        g_debug ("GdmSessionWorkerJob: child (pid:%d) done (%s:%d)",
+        g_warning ("GdmSessionWorkerJob: child '%s' (pid:%d) done (%s:%d)",
+                 job->priv->name,
                  (int) pid,
                  WIFEXITED (status) ? "status"
                  : WIFSIGNALED (status) ? "signal"
@@ -103,6 +105,9 @@ session_worker_job_child_watch (GPid                 pid,
         g_spawn_close_pid (job->priv->pid);
         job->priv->pid = -1;
 
+        g_free (job->priv->name);
+        job->priv->name = NULL;
+
         if (WIFEXITED (status)) {
                 int code = WEXITSTATUS (status);
                 g_signal_emit (job, signals [EXITED], 0, code);
@@ -273,6 +278,7 @@ gdm_session_worker_job_start (GdmSessionWorkerJob *session_worker_job,
 
         g_debug ("GdmSessionWorkerJob: Starting worker...");
 
+        session_worker_job->priv->name = g_strdup (name);
         res = gdm_session_worker_job_spawn (session_worker_job, name);
 
         if (res) {



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