From 2e4bb8390a77d5bee6de3fcb0a46c55fb90b092d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 26 Feb 2026 21:31:04 +0100 Subject: [PATCH] Modernize configure.ac Fix warnings from newer versions of autotools, and assume we are living in the 21st century. --- configure.ac | 10 ++++------ src/process.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index ca2948aa..0641015e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.61) +AC_PREREQ([2.72]) AC_INIT([tinc], [1.0.36]) AC_CONFIG_SRCDIR([src/tincd.c]) AM_INIT_AUTOMAKE([1.11 check-news std-options subdir-objects nostdinc silent-rules -Wall]) @@ -11,14 +11,12 @@ AM_SILENT_RULES([yes]) # Enable GNU extensions. # Define this here, not in acconfig's @TOP@ section, since definitions # in the latter don't make it into the configure-time tests. -AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) dnl Checks for programs. -AC_PROG_CC_C99 -AC_PROG_CPP +AC_PROG_CC AC_PROG_INSTALL - AM_PROG_CC_C_O dnl Check and set OS @@ -195,7 +193,7 @@ AC_CHECK_TYPES([socklen_t, struct ether_header, struct arphdr, struct ether_arp, ) dnl Checks for library functions. -AC_TYPE_SIGNAL + AC_CHECK_FUNCS([asprintf daemon fchmod flock fork gettimeofday mlockall pselect putenv strsignal system unsetenv usleep vsyslog devname fdevname], [], [], [#include "$srcdir/src/have.h"] ) diff --git a/src/process.c b/src/process.c index 13d10071..9b9bcfdc 100644 --- a/src/process.c +++ b/src/process.c @@ -504,7 +504,7 @@ bool execute_script(const char *name, char **envp) { */ #ifndef HAVE_MINGW -static RETSIGTYPE sigterm_handler(int a) { +static void sigterm_handler(int a) { (void)a; logger(LOG_NOTICE, "Got %s signal", "TERM"); @@ -515,7 +515,7 @@ static RETSIGTYPE sigterm_handler(int a) { } } -static RETSIGTYPE sigquit_handler(int a) { +static void sigquit_handler(int a) { (void)a; logger(LOG_NOTICE, "Got %s signal", "QUIT"); @@ -526,13 +526,13 @@ static RETSIGTYPE sigquit_handler(int a) { } } -static RETSIGTYPE fatal_signal_square(int a) { +static void fatal_signal_square(int a) { logger(LOG_ERR, "Got another fatal signal %d (%s): not restarting.", a, strsignal(a)); exit(1); } -static RETSIGTYPE fatal_signal_handler(int a) { +static void fatal_signal_handler(int a) { struct sigaction act; logger(LOG_ERR, "Got fatal signal %d (%s)", a, strsignal(a)); @@ -554,13 +554,13 @@ static RETSIGTYPE fatal_signal_handler(int a) { } } -static RETSIGTYPE sighup_handler(int a) { +static void sighup_handler(int a) { (void)a; logger(LOG_NOTICE, "Got %s signal", "HUP"); sighup = true; } -static RETSIGTYPE sigint_handler(int a) { +static void sigint_handler(int a) { (void)a; static int saved_debug_level = -1; @@ -580,18 +580,18 @@ static RETSIGTYPE sigint_handler(int a) { } } -static RETSIGTYPE sigalrm_handler(int a) { +static void sigalrm_handler(int a) { (void)a; logger(LOG_NOTICE, "Got %s signal", "ALRM"); sigalrm = true; } -static RETSIGTYPE sigusr1_handler(int a) { +static void sigusr1_handler(int a) { (void)a; dump_connections(); } -static RETSIGTYPE sigusr2_handler(int a) { +static void sigusr2_handler(int a) { (void)a; devops.dump_stats(); dump_nodes(); @@ -599,17 +599,17 @@ static RETSIGTYPE sigusr2_handler(int a) { dump_subnets(); } -static RETSIGTYPE sigwinch_handler(int a) { +static void sigwinch_handler(int a) { (void)a; do_purge = true; } -static RETSIGTYPE unexpected_signal_handler(int a) { +static void unexpected_signal_handler(int a) { (void)a; logger(LOG_WARNING, "Got unexpected signal %d (%s)", a, strsignal(a)); } -static RETSIGTYPE ignore_signal_handler(int a) { +static void ignore_signal_handler(int a) { (void)a; ifdebug(SCARY_THINGS) logger(LOG_DEBUG, "Ignored signal %d (%s)", a, strsignal(a)); } -- 2.47.3