X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fsignals.c;h=eb26e632317be1075936a8981f8fe5a17c90ec71;hb=d00b170aa19a82a22bf55516f2cdb33e26deca0c;hp=a8c12d62d51c9c26b90badfcf034e2b229dda98f;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b;p=mmh diff --git a/sbr/signals.c b/sbr/signals.c index a8c12d6..eb26e63 100644 --- a/sbr/signals.c +++ b/sbr/signals.c @@ -2,53 +2,28 @@ /* * signals.c -- general signals interface for nmh * - * $Id$ + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include #include -int -SIGPROCMASK (int how, const sigset_t *set, sigset_t *oset) -{ -#ifdef POSIX_SIGNALS - return sigprocmask(how, set, oset); -#else -# ifdef BSD_SIGNALS - switch(how) { - case SIG_BLOCK: - *oset = sigblock(*set); - break; - case SIG_UNBLOCK: - sigfillset(*oset); - *oset = sigsetmask(*oset); - sigsetmask(*oset & ~(*set)); - break; - case SIG_SETMASK: - *oset = sigsetmask(*set); - break; - default: - adios(NULL, "unknown flag in SIGPROCMASK"); - break; - } - return 0; -# endif -#endif -} - - /* * A version of the function `signal' that uses reliable * signals, if the machine supports them. Also, (assuming * OS support), it restarts interrupted system calls for all * signals except SIGALRM. + * + * Since we are now assuming POSIX signal support everywhere, we always + * use reliable signals. */ SIGNAL_HANDLER SIGNAL (int sig, SIGNAL_HANDLER func) { -#ifdef POSIX_SIGNALS struct sigaction act, oact; act.sa_handler = func; @@ -67,9 +42,6 @@ SIGNAL (int sig, SIGNAL_HANDLER func) if (sigaction(sig, &act, &oact) < 0) return (SIG_ERR); return (oact.sa_handler); -#else - return signal (sig, func); -#endif } @@ -82,7 +54,6 @@ SIGNAL (int sig, SIGNAL_HANDLER func) SIGNAL_HANDLER SIGNAL2 (int sig, SIGNAL_HANDLER func) { -#ifdef POSIX_SIGNALS struct sigaction act, oact; if (sigaction(sig, NULL, &oact) < 0) @@ -105,12 +76,5 @@ SIGNAL2 (int sig, SIGNAL_HANDLER func) return (SIG_ERR); } return (oact.sa_handler); -#else - SIGNAL_HANDLER ofunc; - - if ((ofunc = signal (sig, SIG_IGN)) != SIG_IGN) - signal (sig, func); - return ofunc; -#endif }