diff options
author | Eric Blake <ebb9@byu.net> | 2009-12-30 14:42:41 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-12-31 07:04:04 -0700 |
commit | 2adf9eb9d57d54eea767e18b550ee26f70d27dcf (patch) | |
tree | 5100120895c26c96b194dfa4946ca35dd3ec6eef /tests | |
parent | 0bf85001e78afe170ee53158a5ca3c2036b5da99 (diff) | |
download | gnulib-2adf9eb9d57d54eea767e18b550ee26f70d27dcf.tar.gz |
signal, spawn: use link warnings
These modules depended on link-warning, then didn't use it.
* lib/signal.in.h (sigset_t): Make unconditional.
(sigismember, sigemptyset, sigaddset, sigdelset, sigfillset)
(sigpending, sigprocmask, sigaction): Add link warnings.
* lib/spawn.in.h (posix_spawn, posix_spawnp, posix_spawnattr_init)
(posix_spawnattr_destroy, posix_spawnattr_getsigdefault)
(posix_spawnattr_setsigdefault, posix_spawnattr_getsigmask)
(posix_spawnattr_setsigmask, posix_spawnattr_getflags)
(posix_spawnattr_setflags, posix_spawnattr_getpgroup)
(posix_spawnattr_setpgroup, posix_spawnattr_getschedpolicy)
(posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam)
(posix_spawnattr_setschedparam, posix_spawn_file_actions_init)
(posix_spawn_file_actions_destroy)
(posix_spawn_file_actions_addopen)
(posix_spawn_file_actions_addclose)
(posix_spawwn_file_actions_adddup2): Likewise.
* m4/signal_h.m4 (gl_SIGNAL_H): Guarantee uid_t.
* tests/test-signal.c (main): Enhance test.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-signal.c | 103 |
1 files changed, 101 insertions, 2 deletions
diff --git a/tests/test-signal.c b/tests/test-signal.c index 5154f4e953..b0c11cf84a 100644 --- a/tests/test-signal.c +++ b/tests/test-signal.c @@ -20,10 +20,109 @@ #include <signal.h> -volatile sig_atomic_t s; +/* Check for required types. */ +struct +{ + size_t a; + uid_t b; + volatile sig_atomic_t c; + sigset_t d; + pid_t e; +#if 0 + /* Not guaranteed by gnulib. */ + pthread_t f; + struct timespec g; +#endif +} s; int main (void) { - return s; + switch (0) + { + /* The following are guaranteed by C. */ + case 0: + case SIGABRT: + case SIGFPE: + case SIGILL: + case SIGINT: + case SIGSEGV: + case SIGTERM: + /* The following is guaranteed by gnulib. */ +#if GNULIB_SIGPIPE || defined SIGPIPE + case SIGPIPE: +#endif + /* Ensure no conflict with other standardized names. */ +#ifdef SIGALRM + case SIGALRM: +#endif +#ifdef SIGBUS + case SIGBUS: +#endif +#ifdef SIGCHLD + case SIGCHLD: +#endif +#ifdef SIGCONT + case SIGCONT: +#endif +#ifdef SIGHUP + case SIGHUP: +#endif +#ifdef SIGKILL + case SIGKILL: +#endif +#ifdef SIGQUIT + case SIGQUIT: +#endif +#ifdef SIGSTOP + case SIGSTOP: +#endif +#ifdef SIGTSTP + case SIGTSTP: +#endif +#ifdef SIGTTIN + case SIGTTIN: +#endif +#ifdef SIGTTOU + case SIGTTOU: +#endif +#ifdef SIGUSR1 + case SIGUSR1: +#endif +#ifdef SIGUSR2 + case SIGUSR2: +#endif +#ifdef SIGSYS + case SIGSYS: +#endif +#ifdef SIGTRAP + case SIGTRAP: +#endif +#ifdef SIGURG + case SIGURG: +#endif +#ifdef SIGVTALRM + case SIGVTALRM: +#endif +#ifdef SIGXCPU + case SIGXCPU: +#endif +#ifdef SIGXFSZ + case SIGXFSZ: +#endif +#ifdef SIG + case SIG: +#endif + /* SIGRTMIN and SIGRTMAX need not be compile-time constants. */ +#if 0 +# ifdef SIGRTMIN + case SIGRTMIN: +# endif +# ifdef SIGRTMAX + case SIGRTMAX: +# endif +#endif + ; + } + return s.a + s.b + s.c + s.e; } |