summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-11-27 10:15:44 -0500
committerDan Winship <danw@gnome.org>2013-11-27 10:42:32 -0500
commit695070b52e1c5b849993b0a1bb24e23d59434059 (patch)
tree40486cd86fca3a1078e7a787e48d3f91e98a4748
parent1300108e0c50e70d5414c195649ad41419074e1a (diff)
downloadglib-695070b52e1c5b849993b0a1bb24e23d59434059.tar.gz
Fix the gtestutils core dump prevention again
The previous patch was preventing core dumps on failed assertions, but not on g_error()s.
-rw-r--r--glib/gmessages.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/glib/gmessages.c b/glib/gmessages.c
index c8f3c42d8..a8af5fed5 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -290,10 +290,10 @@ static gpointer fatal_log_data;
/* --- functions --- */
-static void _g_log_abort (void) G_GNUC_NORETURN;
+static void _g_log_abort (gboolean breakpoint) G_GNUC_NORETURN;
static void
-_g_log_abort (void)
+_g_log_abort (gboolean breakpoint)
{
if (g_test_subprocess ())
{
@@ -304,6 +304,9 @@ _g_log_abort (void)
*/
_exit (1);
}
+
+ if (breakpoint)
+ G_BREAKPOINT ();
else
abort ();
}
@@ -1033,15 +1036,9 @@ g_logv (const gchar *log_domain,
MessageBox (NULL, locale_msg, NULL,
MB_ICONERROR|MB_SETFOREGROUND);
}
- if (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION))
- G_BREAKPOINT ();
- else
- _g_log_abort ();
+ _g_log_abort (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION));
#else
- if (!(test_level & G_LOG_FLAG_RECURSION))
- G_BREAKPOINT ();
- else
- _g_log_abort ();
+ _g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
#endif /* !G_OS_WIN32 */
}
@@ -1132,7 +1129,7 @@ g_assert_warning (const char *log_domain,
line,
pretty_function,
expression);
- _g_log_abort ();
+ _g_log_abort (FALSE);
}
/**