Support st_nmtime in struct stat as found in HP-UX.
This commit is contained in:
@@ -814,6 +814,9 @@
|
||||
/* Define to 1 if your struct stat has an st_mtimespec member. */
|
||||
#undef HAVE_ST_MTIMESPEC
|
||||
|
||||
/* Define to 1 if your struct stat has an st_nmtime member. */
|
||||
#undef HAVE_ST_NMTIME
|
||||
|
||||
/* Define to 1 if your struct stat uses an st__tim union. */
|
||||
#undef HAVE_ST__TIM
|
||||
|
||||
|
10
configure
vendored
10
configure
vendored
@@ -20975,8 +20975,17 @@ else
|
||||
if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes; then :
|
||||
$as_echo "#define HAVE_ST_MTIMESPEC 1" >>confdefs.h
|
||||
|
||||
else
|
||||
ac_fn_c_check_member "$LINENO" "struct stat" "st_nmtime" "ac_cv_member_struct_stat_st_nmtime" "$ac_includes_default"
|
||||
if test "x$ac_cv_member_struct_stat_st_nmtime" = xyes; then :
|
||||
$as_echo "#define HAVE_ST_NMTIME 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# Look for sha2 functions if not using openssl
|
||||
@@ -29141,5 +29150,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
10
configure.ac
10
configure.ac
@@ -2836,9 +2836,14 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff], [], [], [
|
||||
AC_INCLUDES_DEFAULT
|
||||
#include <errno.h>
|
||||
])
|
||||
AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
|
||||
AC_CHECK_MEMBER([struct stat.st_mtim],
|
||||
[AC_DEFINE(HAVE_ST_MTIM)]
|
||||
[AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
|
||||
[AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
|
||||
[AC_CHECK_MEMBER([struct stat.st_mtimespec],
|
||||
[AC_DEFINE([HAVE_ST_MTIMESPEC])],
|
||||
[AC_CHECK_MEMBER([struct stat.st_nmtime], AC_DEFINE(HAVE_ST_NMTIME))])
|
||||
]
|
||||
)
|
||||
# Look for sha2 functions if not using openssl
|
||||
if test "$DIGEST" = "digest.lo"; then
|
||||
FOUND_SHA2=no
|
||||
@@ -4578,6 +4583,7 @@ AH_TEMPLATE(HAVE_SOLARIS_AUDIT, [Define to 1 to enable Solaris audit support.])
|
||||
AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union.])
|
||||
AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member.])
|
||||
AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member.])
|
||||
AH_TEMPLATE(HAVE_ST_NMTIME, [Define to 1 if your struct stat has an st_nmtime member.])
|
||||
AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
|
||||
AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
|
||||
AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements.])
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2016 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||
* Copyright (c) 2013-2018 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -136,6 +136,8 @@
|
||||
# else
|
||||
# define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->SUDO_ST_MTIM.tv_sec; (_y).tv_nsec = ((_x)->SUDO_ST_MTIM.tv_nsec / 1000) * 1000; } while (0)
|
||||
# endif
|
||||
#elif defined(HAVE_ST_NMTIME)
|
||||
# define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->st_mtime; (_y).tv_nsec = (_x)->st_nmtime; } while (0)
|
||||
#else
|
||||
# define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->st_mtime; (_y).tv_nsec = 0; } while (0)
|
||||
#endif /* HAVE_ST_MTIM */
|
||||
|
@@ -52,6 +52,9 @@
|
||||
#elif defined(HAVE_ST_MTIMESPEC)
|
||||
# define ATIME_TO_TIMEVAL(_x, _y) TIMESPEC_TO_TIMEVAL((_x), &(_y)->st_atimespec)
|
||||
# define MTIME_TO_TIMEVAL(_x, _y) TIMESPEC_TO_TIMEVAL((_x), &(_y)->st_mtimespec)
|
||||
#elif defined(HAVE_ST_NMTIME)
|
||||
# define ATIME_TO_TIMEVAL(_x, _y) do { (_x)->tv_sec = (_y)->st_atime; (_x)->tv_usec = (_y)->st_natime; } while (0)
|
||||
# define MTIME_TO_TIMEVAL(_x, _y) do { (_x)->tv_sec = (_y)->st_mtime; (_x)->tv_usec = (_y)->st_nmtime; } while (0)
|
||||
#else
|
||||
# define ATIME_TO_TIMEVAL(_x, _y) do { (_x)->tv_sec = (_y)->st_atime; (_x)->tv_usec = 0; } while (0)
|
||||
# define MTIME_TO_TIMEVAL(_x, _y) do { (_x)->tv_sec = (_y)->st_mtime; (_x)->tv_usec = 0; } while (0)
|
||||
|
Reference in New Issue
Block a user