aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-01-30 12:46:44 -0800
committerGuy Harris <gharris@sonic.net>2023-01-30 15:04:25 -0800
commit7ceb6016de4e188a215427bc035a941ad1fceb1c (patch)
tree2cbe56c5a0a62831a4a98d94a8c50f593b2f4e56
parent66aae3b28d8afcc49959dacc1512a666cb98e4cf (diff)
downloadtcpdump-7ceb6016de4e188a215427bc035a941ad1fceb1c.tar.gz
configure, CMakeLists.txt: don't check for snprintf().
It's specified by the C90 standard (and, as I remember, by the C89 standard, although I no longer have my paper copy); no need to worry about ancient environments that lack it, and we have some cases where we call it in code not protected by #ifdef HAVE_STRFTIME/#endif and haven't seen any reports of problems. (cherry picked from commit af51eea2909c10b540dba6c1b2a1e7e18e230993)
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmakeconfig.h.in5
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--ntp.c2
-rw-r--r--print-ntp.c2
-rw-r--r--print-zep.c2
8 files changed, 3 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73f32eaa..9495b5d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -411,7 +411,6 @@ if(NOT HAVE_SNPRINTF)
endif()
check_function_exists(getopt_long HAVE_GETOPT_LONG)
-check_function_exists(strftime HAVE_STRFTIME)
check_function_exists(setlinebuf HAVE_SETLINEBUF)
#
# For Windows, don't need to waste time checking for fork() or vfork().
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index 370d3962..02a4a352 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -102,7 +102,7 @@
/* Define to 1 if you have the `pcap_dump_flush' function. */
#cmakedefine HAVE_PCAP_DUMP_FLUSH 1
-/* define if libpcap has pcap_dump_ftell() */
+/* Define to 1 if you have the `pcap_dump_ftell' function. */
#cmakedefine HAVE_PCAP_DUMP_FTELL 1
/* Define to 1 if you have the `pcap_dump_ftell64' function. */
@@ -180,9 +180,6 @@
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP 1
-/* Define to 1 if you have the `strftime' function. */
-#cmakedefine HAVE_STRFTIME 1
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
diff --git a/config.h.in b/config.h.in
index 439038a6..59bc6120 100644
--- a/config.h.in
+++ b/config.h.in
@@ -180,9 +180,6 @@
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* 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
diff --git a/configure b/configure
index 07288316..954550f8 100755
--- a/configure
+++ b/configure
@@ -5107,7 +5107,7 @@ esac
fi
-for ac_func in fork vfork strftime
+for ac_func in fork vfork
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index 88ed6365..18d59b6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,7 +380,7 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
fi
AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
-AC_CHECK_FUNCS(fork vfork strftime)
+AC_CHECK_FUNCS(fork vfork)
AC_CHECK_FUNCS(setlinebuf)
#
diff --git a/ntp.c b/ntp.c
index 4d17932f..10fabe4b 100644
--- a/ntp.c
+++ b/ntp.c
@@ -48,7 +48,6 @@ p_ntp_time(netdissect_options *ndo,
f = (uint32_t)(ff * 1000000000.0); /* treat fraction as parts per billion */
ND_PRINT("%u.%09u", i, f);
-#ifdef HAVE_STRFTIME
/*
* print the UTC time in human-readable format.
*/
@@ -81,5 +80,4 @@ p_ntp_time(netdissect_options *ndo,
}
}
}
-#endif
}
diff --git a/print-ntp.c b/print-ntp.c
index 99c08963..4b029172 100644
--- a/print-ntp.c
+++ b/print-ntp.c
@@ -38,9 +38,7 @@
#include "netdissect-stdinc.h"
-#ifdef HAVE_STRFTIME
#include <time.h>
-#endif
#include "netdissect.h"
#include "addrtoname.h"
diff --git a/print-zep.c b/print-zep.c
index fd74368c..8119a19e 100644
--- a/print-zep.c
+++ b/print-zep.c
@@ -77,7 +77,6 @@ static void zep_print_ts(netdissect_options *ndo, const u_char *p)
billion */
ND_PRINT("%u.%09d", i, f);
-#ifdef HAVE_STRFTIME
/*
* print the time in human-readable format.
*/
@@ -90,7 +89,6 @@ static void zep_print_ts(netdissect_options *ndo, const u_char *p)
strftime(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S", tm);
ND_PRINT(" (%s)", time_buf);
}
-#endif
}
/*