X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-sigaction.c;h=30c4744d1d96dd0ba7489522becbb388df823761;hb=314fcbb7de94709b92edf1b68f62ca6aed8d4dbc;hp=81abe8919029c2eee779ebddb7419bd94ceca130;hpb=cfb3906f210bec09f48f5d48511b72064153311a;p=gnulib.git diff --git a/tests/test-sigaction.c b/tests/test-sigaction.c index 81abe8919..30c4744d1 100644 --- a/tests/test-sigaction.c +++ b/tests/test-sigaction.c @@ -36,9 +36,24 @@ } \ while (0) +#ifndef SA_NOCLDSTOP +# define SA_NOCLDSTOP 0 +#endif +#ifndef SA_ONSTACK +# define SA_ONSTACK 0 +#endif #ifndef SA_SIGINFO # define SA_SIGINFO 0 #endif +#ifndef SA_NOCLDWAIT +# define SA_NOCLDWAIT 0 +#endif + +/* Define a mask of flags required by POSIX. Some implementations + provide other flags as extensions, such as SA_RESTORER, that we + must ignore in this test. */ +#define MASK_SA_FLAGS (SA_NOCLDSTOP | SA_ONSTACK | SA_RESETHAND | SA_RESTART \ + | SA_SIGINFO | SA_NOCLDWAIT | SA_NODEFER) /* This test is unsafe in the presence of an asynchronous SIGABRT, because we install a signal-handler that is intentionally not @@ -80,7 +95,7 @@ main (int argc, char *argv[]) ASSERT (raise (SIGABRT) == 0); sa.sa_flags = SA_RESETHAND | SA_NODEFER; ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); - ASSERT (old_sa.sa_flags == 0); + ASSERT ((old_sa.sa_flags & MASK_SA_FLAGS) == 0); ASSERT (old_sa.sa_handler == handler); ASSERT (raise (SIGABRT) == 0); sa.sa_handler = SIG_DFL;