From d0f53b8cc96d84c84873198beb535f06d4b3197a Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Thu, 21 Jan 2016 21:19:46 +0100 Subject: [PATCH] Replace CENV_SYSF_SIGSET with HAVE_SIGACTION --- configure.ac | 2 +- mk/top.mk | 2 +- src/cenv.h | 4 ---- src/dpsup.c | 4 ++-- src/osdsup.c | 10 ++++++---- src/osdsup.h | 5 +++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 0238507..577e36c 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([alarm dup2 gettimeofday localtime_r memset socket strcasecmp \ strchr strcspn strerror strncasecmp strpbrk strrchr strtol \ - getifaddrs if_nameindex termios sigsetops sigaction nanosleep \ + getifaddrs if_nameindex termios sigaction nanosleep \ gettimeofday getrusage setitimer]) # Check for CPU. diff --git a/mk/top.mk b/mk/top.mk index 8c1e17b..4ec6498 100644 --- a/mk/top.mk +++ b/mk/top.mk @@ -17,7 +17,7 @@ SRC = @top_srcdir@/src BLDSRC = @top_builddir@/src -CC = @CC@ +CC ?= @CC@ CFLAGS = -c @CFLAGS@ -I$(BLDSRC) -I$(SRC) CFLAGS_LINT = -ansi -pedantic -Wall -Wshadow \ -Wstrict-prototypes -Wmissing-prototypes \ diff --git a/src/cenv.h b/src/cenv.h index 3bda1e2..e39f478 100644 --- a/src/cenv.h +++ b/src/cenv.h @@ -222,10 +222,6 @@ #ifndef CENV_SYSF_BSDTTY /* Has old BSD tty stuff */ # define CENV_SYSF_BSDTTY (!CENV_SYSF_TERMIOS && CENV_SYS_BSD) #endif -#ifndef CENV_SYSF_SIGSET /* Has sigsetops(3) and sigaction(2) */ -# define CENV_SYSF_SIGSET (CENV_SYS_DECOSF|CENV_SYS_SUN|CENV_SYS_SOLARIS \ - |CENV_SYS_XBSD|CENV_SYS_LINUX) -#endif /* Large File Support (LFS) * See diff --git a/src/dpsup.c b/src/dpsup.c index f6dc871..75807d8 100644 --- a/src/dpsup.c +++ b/src/dpsup.c @@ -696,7 +696,7 @@ dp_strerror(int err) static int dp_signal(int sig, void (*func)(int)) { -#if CENV_SYSF_SIGSET +#if HAVE_SIGACTION struct sigaction act, oact; act.sa_handler = func; @@ -730,7 +730,7 @@ dp_sleep(int secs) #if CENV_SYS_DECOSF sleep(secs); /* Independent of interval timers! */ -#elif HAVE_SETITIMER && CENV_SYSF_SIGSET +#elif HAVE_SETITIMER && HAVE_SIGACTION /* Must save & restore ITIMER_REAL & SIGALRM, which conflict w/sleep() */ struct itimerval ztm, otm; struct sigaction act, oact; diff --git a/src/osdsup.c b/src/osdsup.c index b0d4ffe..495859d 100644 --- a/src/osdsup.c +++ b/src/osdsup.c @@ -67,6 +67,8 @@ # if HAVE_SETITIMER # include /* BSD: For setitimer() */ +# endif +# if HAVE_GETRUSAGE # include /* BSD: For getrusage() */ # endif @@ -1127,7 +1129,7 @@ os_vtimer(ossighandler_t *irtn, uint32 usecs) void os_timer_restore(ostimer_t *ostate) { -#if HAVE_SETITIMER && CENV_SYSF_SIGSET +#if HAVE_SETITIMER && HAVE_SIGACTION sigset_t blkset, savset; int ret; @@ -1161,7 +1163,7 @@ os_timer_restore(ostimer_t *ostate) void os_v2rt_idle(ossighandler_t *hdlarg) { -#if HAVE_SETITIMER && CENV_SYSF_SIGSET +#if HAVE_SETITIMER && HAVE_SIGACTION sigset_t allmsk, oldmsk, nomsk; struct itimerval ntval, vtval; static ossighandler_t *handler = NULL; @@ -1523,7 +1525,7 @@ osux_signal(int sig, ossighandler_t *func) int osux_sigact(int sig, ossighandler_t *func, ossigact_t *ossa) { -#if CENV_SYSF_SIGSET +#if HAVE_SIGACTION struct sigaction act; act.sa_handler = func; @@ -1550,7 +1552,7 @@ osux_sigact(int sig, ossighandler_t *func, ossigact_t *ossa) int osux_sigrestore(ossigact_t *ossa) { -#if CENV_SYSF_SIGSET +#if HAVE_SIGACTION return sigaction(ossa->ossa_sig, &ossa->ossa_sa, (struct sigaction *)NULL); #elif CENV_SYS_BSD diff --git a/src/osdsup.h b/src/osdsup.h index 12f5a4f..6363328 100644 --- a/src/osdsup.h +++ b/src/osdsup.h @@ -106,7 +106,8 @@ typedef void ossighandler_t(int); # define SIG_ERR ((ossighandler_t *)-1) #endif -#if CENV_SYSF_SIGSET +/* HAVE_SIGACTION pretty much implies the sigemptyset functions/macros */ +#if HAVE_SIGACTION # define ossigset_t sigset_t # define os_sigemptyset(set) sigemptyset(set) # define os_sigfillset(set) sigfillset(set) @@ -133,7 +134,7 @@ typedef void ossighandler_t(int); typedef struct { int ossa_sig; -#if CENV_SYSF_SIGSET +#if HAVE_SIGACTION struct sigaction ossa_sa; #else ossighandler_t *ossa_handler;