X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-sigaction.c;h=f83b87b927e32465c5e6917d7a3ac0756945fdef;hb=ca2c85799ac5e86ba2d93a6b0628648177984e21;hp=55da288b42f20ee5664d5f9ae0bc3217d0d3dcde;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/tests/test-sigaction.c b/tests/test-sigaction.c index 55da288b4..f83b87b92 100644 --- a/tests/test-sigaction.c +++ b/tests/test-sigaction.c @@ -1,5 +1,5 @@ /* Test of sigaction() function. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,21 +20,13 @@ #include -#include -#include - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - signal (SIGABRT, SIG_DFL); \ - abort (); \ - } \ - } \ - while (0) +#include "signature.h" +SIGNATURE_CHECK (sigaction, int, (int, struct sigaction const *, + struct sigaction *)); + +#include + +#include "macros.h" #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 @@ -42,6 +34,12 @@ #ifndef SA_ONSTACK # define SA_ONSTACK 0 #endif +#ifndef SA_RESETHAND +# define SA_RESETHAND 0 +#endif +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif #ifndef SA_SIGINFO # define SA_SIGINFO 0 #endif @@ -79,7 +77,7 @@ handler (int sig) /* This assertion fails on glibc-2.3.6 systems with LinuxThreads, when this program is linked with -lpthread, due to the sigaction() override in libpthread.so. */ -#if !defined __GLIBC__ +#if !(defined __GLIBC__ || defined __UCLIBC__) ASSERT (sa.sa_handler == SIG_DFL); #endif break; @@ -109,7 +107,7 @@ main (void) sa.sa_handler = SIG_DFL; ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0); -#if !defined __GLIBC__ /* see above */ +#if !(defined __GLIBC__ || defined __UCLIBC__) /* see above */ ASSERT (old_sa.sa_handler == SIG_DFL); #endif