From 56a63c1568a30147162044c989fe2f7d6ce8bc72 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Aug 2005 19:32:32 +0000 Subject: [PATCH] Wait for the child process and then simply return. This makes The "S" 2005-08-15 Matthias Clasen * glib/gbacktrace.c (g_on_error_stack_trace): Wait for the child process and then simply return. This makes The "S" option work as documented in g_on_error_query(). (#313125, Matthew F. Barnes) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gbacktrace.c | 8 ++++---- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09c4f8ec..1493588a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-08-15 Matthias Clasen + * glib/gbacktrace.c (g_on_error_stack_trace): Wait for + the child process and then simply return. This makes + The "S" option work as documented in g_on_error_query(). + (#313125, Matthew F. Barnes) + * glib/gunicode.h: Update the link to Unicode category values. (#313369, Behnam Esfahbod) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 09c4f8ec..1493588a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,10 @@ 2005-08-15 Matthias Clasen + * glib/gbacktrace.c (g_on_error_stack_trace): Wait for + the child process and then simply return. This makes + The "S" option work as documented in g_on_error_query(). + (#313125, Matthew F. Barnes) + * glib/gunicode.h: Update the link to Unicode category values. (#313369, Behnam Esfahbod) diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 09c4f8ec..1493588a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,5 +1,10 @@ 2005-08-15 Matthias Clasen + * glib/gbacktrace.c (g_on_error_stack_trace): Wait for + the child process and then simply return. This makes + The "S" option work as documented in g_on_error_query(). + (#313125, Matthew F. Barnes) + * glib/gunicode.h: Update the link to Unicode category values. (#313369, Behnam Esfahbod) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 09c4f8ec..1493588a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,10 @@ 2005-08-15 Matthias Clasen + * glib/gbacktrace.c (g_on_error_stack_trace): Wait for + the child process and then simply return. This makes + The "S" option work as documented in g_on_error_query(). + (#313125, Matthew F. Barnes) + * glib/gunicode.h: Update the link to Unicode category values. (#313369, Behnam Esfahbod) diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index 934c8cad..a60e319d 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -45,6 +45,7 @@ #include #endif #include +#include #include #ifdef HAVE_UNISTD_H @@ -161,6 +162,7 @@ g_on_error_stack_trace (const gchar *prg_name) pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; + int status; if (!prg_name) return; @@ -181,10 +183,8 @@ g_on_error_stack_trace (const gchar *prg_name) perror ("unable to fork gdb"); return; } - - while (glib_on_error_halt) - ; - glib_on_error_halt = TRUE; + + waitpid (pid, &status, 0); #else if (IsDebuggerPresent ()) G_BREAKPOINT (); -- 2.34.1