mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 13:28:02 +02:00
test_init: convert SIGALRM into SIGABRT so we leave a core dump on timeout
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89222 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
This commit is contained in:
parent
c4279c1f37
commit
909762fd08
1 changed files with 17 additions and 0 deletions
|
|
@ -393,6 +393,14 @@ time_out (gpointer data)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
static void
|
||||
wrap_abort (int signal)
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
test_init (int *argcp, char ***argvp)
|
||||
{
|
||||
|
|
@ -409,5 +417,14 @@ test_init (int *argcp, char ***argvp)
|
|||
/* The GLib main loop might not be running (we don't use it in every
|
||||
* test). Die with SIGALRM shortly after if necessary. */
|
||||
alarm (TIMEOUT + 10);
|
||||
|
||||
/* Get a core dump from the SIGALRM. */
|
||||
{
|
||||
struct sigaction act = { };
|
||||
|
||||
act.sa_handler = wrap_abort;
|
||||
|
||||
sigaction (SIGALRM, &act, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue