From 212169387933a9106d44663d7068561747aa7d22 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 24 Sep 2018 14:21:58 -0600 Subject: [PATCH] Move definition of TIME_T_MAX to sudo_util.h --- include/sudo_util.h | 8 ++++++++ plugins/sudoers/defaults.c | 8 -------- plugins/sudoers/iolog_util.c | 8 -------- plugins/sudoers/regress/starttime/check_starttime.c | 8 -------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/include/sudo_util.h b/include/sudo_util.h index 41d859900..2d3f5f185 100644 --- a/include/sudo_util.h +++ b/include/sudo_util.h @@ -23,6 +23,14 @@ # include "compat/stdbool.h" #endif /* HAVE_STDBOOL_H */ +#ifndef TIME_T_MAX +# if SIZEOF_TIME_T == 8 +# define TIME_T_MAX LLONG_MAX +# else +# define TIME_T_MAX INT_MAX +# endif +#endif + /* * Macros for operating on struct timeval. */ diff --git a/plugins/sudoers/defaults.c b/plugins/sudoers/defaults.c index 76e6cb6ad..eac89e002 100644 --- a/plugins/sudoers/defaults.c +++ b/plugins/sudoers/defaults.c @@ -858,14 +858,6 @@ store_uint(const char *str, union sudo_defs_val *sd_un) debug_return_bool(true); } -#ifndef TIME_T_MAX -# if SIZEOF_TIME_T == 8 -# define TIME_T_MAX LLONG_MAX -# else -# define TIME_T_MAX INT_MAX -# endif -#endif - static bool store_timespec(const char *str, union sudo_defs_val *sd_un) { diff --git a/plugins/sudoers/iolog_util.c b/plugins/sudoers/iolog_util.c index 79f5e2fae..fe11e18b8 100644 --- a/plugins/sudoers/iolog_util.c +++ b/plugins/sudoers/iolog_util.c @@ -50,14 +50,6 @@ #include "sudo_util.h" #include "iolog_util.h" -#ifndef TIME_T_MAX -# if SIZEOF_TIME_T == 8 -# define TIME_T_MAX LLONG_MAX -# else -# define TIME_T_MAX INT_MAX -# endif -#endif - static int timing_idx_adj; struct log_info * diff --git a/plugins/sudoers/regress/starttime/check_starttime.c b/plugins/sudoers/regress/starttime/check_starttime.c index 15dd1f7bf..e858ad370 100644 --- a/plugins/sudoers/regress/starttime/check_starttime.c +++ b/plugins/sudoers/regress/starttime/check_starttime.c @@ -29,14 +29,6 @@ #include "sudo_fatal.h" #include "check.h" -#ifndef TIME_T_MAX -# if SIZEOF_TIME_T == 8 -# define TIME_T_MAX LLONG_MAX -# else -# define TIME_T_MAX INT_MAX -# endif -#endif - __dso_public int main(int argc, char *argv[]); #ifdef __linux__ -- 2.40.0