Remove mysignal wrapper.

We switched the main code to use sigaction(), so the wrapper is no
longer used.
This commit is contained in:
Darren Tucker 2020-01-23 18:55:24 +11:00
parent 5533c2fb7e
commit 84226b447d
2 changed files with 0 additions and 38 deletions

View File

@ -23,39 +23,6 @@
#include "openbsd-compat/bsd-signal.h"
#undef signal
mysig_t
mysignal(int sig, mysig_t act)
{
#ifdef HAVE_SIGACTION
struct sigaction sa, osa;
if (sigaction(sig, NULL, &osa) == -1)
return (mysig_t) -1;
if (osa.sa_handler != act) {
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sig == SIGALRM) {
#ifdef SA_INTERRUPT
sa.sa_flags |= SA_INTERRUPT;
#endif
} else {
#ifdef SA_RESTART
sa.sa_flags |= SA_RESTART;
#endif
}
sa.sa_handler = act;
if (sigaction(sig, &sa, NULL) == -1)
return (mysig_t) -1;
}
return (osa.sa_handler);
#else
return (signal(sig, act));
#endif
}
#if !defined(HAVE_STRSIGNAL)
char *strsignal(int sig)
{

View File

@ -27,11 +27,6 @@
# endif
#endif
/* wrapper for signal interface */
typedef void (*mysig_t)(int);
mysig_t mysignal(int sig, mysig_t act);
#define signal(a,b) mysignal(a,b)
#if !defined(HAVE_STRSIGNAL)
char *strsignal(int);
#endif