tests: Don’t assert for SA_NOCLDSTOP for non-SIGCHLD signals

`SA_NOCLDSTOP` is “meaningful only when establishing a handler for
SIGCHLD” according to [`sigaction(2)`](man:sigaction(2)), so asserting
that it’s set for all signals seems like a bad plan. In particular, it
causes this unit test to fail on macOS.

Indeed, [`kern.c` in
macOS](https://opensource.apple.com/source/xnu/xnu-3789.70.16/bsd/kern/kern_sig.c.auto.html)
only sets `SA_NOCLDSTOP` if the signal is `SIGCHLD`.

Thanks to John Ralls for confirmation with the diagnosis.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3314
This commit is contained in:
Philip Withnall 2024-04-08 11:57:45 +01:00
parent 3ac632b406
commit 3bc225ed16
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -520,7 +520,8 @@ test_signal (int signum)
g_assert_no_errno (sigaction (signum, NULL, &action));
g_assert_true (action.sa_flags & SA_NOCLDSTOP);
if (signum == SIGCHLD)
g_assert_true (action.sa_flags & SA_NOCLDSTOP);
#ifdef SA_RESTART
g_assert_true (action.sa_flags & SA_RESTART);
#endif