From 8e08066bc8be4be68254864f79eac5962bc3cf83 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Sat, 9 Mar 2024 17:01:40 +0000 Subject: [PATCH] Don't generate a corefile when generating SIGSEGV One of the tests uses a child process which generates SIGSEGV. On FreeBSD this generates a corefile by default which breaks the 'make distcheck' process. --- tests/common/test_os_calls_signals.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/common/test_os_calls_signals.c b/tests/common/test_os_calls_signals.c index e917bfec..8028f895 100644 --- a/tests/common/test_os_calls_signals.c +++ b/tests/common/test_os_calls_signals.c @@ -108,6 +108,9 @@ START_TEST(test_g_signal_child_stop_1) pid = g_fork(); if (pid == 0) { + // Before raising the signal, change directory to a non-writeable + // one to avoid generating a corefile. + g_set_current_dir("/"); raise(SIGSEGV); } ck_assert_int_ne(pid, 0);