From 39eb6f2ce43763e46312926e1f81d297eebf2139 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 4 Sep 2020 17:28:31 +0100
Subject: [PATCH] all: Print exit status immediately before exiting

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 src/launch.c   | 1 +
 src/launcher.c | 2 +-
 src/wrap.c     | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/launch.c b/src/launch.c
index 9a27c4c99..54f2e5045 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -871,5 +871,6 @@ out:
   g_hash_table_unref (opt_env);
   g_hash_table_unref (opt_unsetenv);
 
+  g_debug ("Exiting with status %d", launch_exit_status);
   return launch_exit_status;
 }
diff --git a/src/launcher.c b/src/launcher.c
index 7e840e193..7f9c5e644 100644
--- a/src/launcher.c
+++ b/src/launcher.c
@@ -1273,7 +1273,6 @@ main (int argc,
 
   main_loop = g_main_loop_new (NULL, FALSE);
   g_main_loop_run (main_loop);
-  g_debug ("Exiting");
 
 out:
   if (local_error != NULL)
@@ -1306,5 +1305,6 @@ out:
   g_clear_error (&local_error);
   g_clear_pointer (&original_stdout, fclose);
 
+  g_debug ("Exiting with status %d", ret);
   return ret;
 }
diff --git a/src/wrap.c b/src/wrap.c
index 89aa71c09..a8da29920 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -1756,5 +1756,6 @@ out:
   g_clear_pointer (&opt_runtime_base, g_free);
   g_clear_pointer (&opt_runtime, g_free);
 
+  g_debug ("Exiting with status %d", ret);
   return ret;
 }
-- 
GitLab