Module: monitoring-plugins Branch: master Commit: b709a4d858537060a96f2b6986d15d3abcb9529a Author: Holger Weiss <hol...@zedat.fu-berlin.de> Date: Tue Dec 31 11:13:01 2024 +0100 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=b709a4d8
Don't check for TIME_WITH_SYS_TIME Follow the suggestion made by the autoupdate(1) tool: | All current systems provide time.h; it need not be checked for. Not | all systems provide sys/time.h, but those that do, all allow you to | include it and time.h simultaneously. Therefore, include sys/time.h if available, and include time.h unconditionally. --- configure.ac | 15 +-------------- plugins/common.h | 10 ++-------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index e3b66fef..79b44c7b 100644 --- a/configure.ac +++ b/configure.ac @@ -607,23 +607,10 @@ dnl dnl Checks for header files. dnl -m4_warn([obsolete], -[Update your code to rely only on HAVE_SYS_TIME_H, -then remove this warning and the obsolete code below it. -All current systems provide time.h; it need not be checked for. -Not all systems provide sys/time.h, but those that do, all allow -you to include it and time.h simultaneously.])dnl -AC_CHECK_HEADERS_ONCE([sys/time.h]) -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h> - and <time.h>. This macro is obsolete.]) -fi -# End of obsolete code. - AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h) AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) +AC_CHECK_HEADERS_ONCE([sys/time.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/plugins/common.h b/plugins/common.h index 833479ce..b7a7d59b 100644 --- a/plugins/common.h +++ b/plugins/common.h @@ -90,16 +90,10 @@ # define GET_NUMBER_OF_CPUS() -1 #endif -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include <sys/time.h> -# include <time.h> -#else -# ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif #endif +#include <time.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h>