mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +01:00
glib/tests/unix: Disable the alternate signal stack using SS_DISABLE
In other unix implementations other than linux, sigaltstack can't use a NULL pointer for old_stack, so let's use SS_DISABLE instead to disable the alternate stack. Co-Authored-By: Marco Trevisan <mail@3v1n0.net>
This commit is contained in:
parent
8c842792a9
commit
035c318324
@ -593,7 +593,14 @@ test_signal_alternate_stack (int signal)
|
|||||||
*/
|
*/
|
||||||
g_assert_cmpint (memcmp (stack_memory, zero_mem, MINSIGSTKSZ), !=, 0);
|
g_assert_cmpint (memcmp (stack_memory, zero_mem, MINSIGSTKSZ), !=, 0);
|
||||||
|
|
||||||
g_assert_no_errno (sigaltstack (&old_stack, NULL));
|
memset (stack_memory, 0, MINSIGSTKSZ);
|
||||||
|
g_assert_cmpmem (stack_memory, MINSIGSTKSZ, zero_mem, MINSIGSTKSZ);
|
||||||
|
|
||||||
|
stack.ss_flags = SS_DISABLE;
|
||||||
|
g_assert_no_errno (sigaltstack (&stack, &old_stack));
|
||||||
|
|
||||||
|
test_signal (signal);
|
||||||
|
g_assert_cmpmem (stack_memory, MINSIGSTKSZ, zero_mem, MINSIGSTKSZ);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user