[gnome-builder] simple-subprocess: add tracing for process exit reason



commit e0753e34062e451ead2e1af376c969d08df79626
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 31 03:22:00 2016 -0700

    simple-subprocess: add tracing for process exit reason

 libide/subprocess/ide-simple-subprocess.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libide/subprocess/ide-simple-subprocess.c b/libide/subprocess/ide-simple-subprocess.c
index 7047976..c4ef289 100644
--- a/libide/subprocess/ide-simple-subprocess.c
+++ b/libide/subprocess/ide-simple-subprocess.c
@@ -109,6 +109,15 @@ ide_simple_subprocess_wait_cb (GObject      *object,
   g_assert (G_IS_SUBPROCESS (subprocess));
   g_assert (G_IS_TASK (task));
 
+#ifdef IDE_ENABLE_TRACE
+  if (g_subprocess_get_if_exited (subprocess))
+    IDE_TRACE_MSG ("subprocess exited with exit status: %d",
+                   g_subprocess_get_exit_status (subprocess));
+  else
+    IDE_TRACE_MSG ("subprocess exited due to signal: %d",
+                   g_subprocess_get_term_sig (subprocess));
+#endif
+
   if (!g_subprocess_wait_finish (subprocess, result, &error))
     g_task_return_error (task, g_steal_pointer (&error));
   else


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