mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
Fix the gtestutils core dump prevention again
The previous patch was preventing core dumps on failed assertions, but not on g_error()s.
This commit is contained in:
parent
1300108e0c
commit
695070b52e
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user