strftime() was in C89 so use it unconditionally.

This commit is contained in:
Todd C. Miller
2017-02-18 16:23:40 -07:00
parent e5dee1557e
commit fd40d88ba7
4 changed files with 2 additions and 23 deletions

View File

@@ -654,9 +654,6 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H

3
configure vendored
View File

@@ -2847,7 +2847,6 @@ as_fn_append ac_header_list " sys/sysmacros.h"
as_fn_append ac_func_list " fexecve"
as_fn_append ac_func_list " killpg"
as_fn_append ac_func_list " nl_langinfo"
as_fn_append ac_func_list " strftime"
as_fn_append ac_func_list " pread"
as_fn_append ac_func_list " pwrite"
as_fn_append ac_func_list " openat"
@@ -18692,8 +18691,6 @@ done
case "$host_os" in
hpux*)
if test X"$ac_cv_func_pread" = X"yes"; then

View File

@@ -2394,7 +2394,7 @@ dnl
dnl Function checks
dnl
AC_FUNC_GETGROUPS
AC_CHECK_FUNCS_ONCE([fexecve killpg nl_langinfo strftime pread pwrite openat faccessat wordexp])
AC_CHECK_FUNCS_ONCE([fexecve killpg nl_langinfo pread pwrite openat faccessat wordexp])
case "$host_os" in
hpux*)
if test X"$ac_cv_func_pread" = X"yes"; then

View File

@@ -28,13 +28,10 @@
/*
* Return a static buffer with the current date + time.
* Uses strftime() if available, else falls back to ctime().
*/
char *
get_timestr(time_t tstamp, int log_year)
{
char *s;
#ifdef HAVE_STRFTIME
static char buf[128];
struct tm *timeptr;
@@ -45,17 +42,5 @@ get_timestr(time_t tstamp, int log_year)
timeptr) != 0 && buf[sizeof(buf) - 1] == '\0')
return buf;
}
#endif /* HAVE_STRFTIME */
s = ctime(&tstamp);
if (s != NULL) {
s += 4; /* skip day of the week */
if (log_year)
s[20] = '\0'; /* avoid the newline */
else
s[15] = '\0'; /* don't care about year */
}
return s;
return NULL;
}