Skip to content

Commit

Permalink
Fixed wrong timestamp under Free- and OpenBSD and macOS over configur…
Browse files Browse the repository at this point in the history
…e.ac
  • Loading branch information
gsnw-sebast committed May 27, 2021
1 parent eac2034 commit 2d8d292
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ AC_PREREQ(2.59)
AC_INIT([fping],[5.0])
AC_GNU_SOURCE

AC_CANONICAL_HOST
only_clock_realtime=no

case "${host_os}" in
darwin*)
only_clock_realtime=yes
;;
*freebsd*)
only_clock_realtime=yes
;;
*openbsd*)
only_clock_realtime=yes
;;
esac

dnl --disable-ipv4
AC_ARG_ENABLE([ipv4],
AS_HELP_STRING([--disable-ipv4], [Disable support for pinging IPv4 hosts]))
Expand Down Expand Up @@ -43,6 +58,7 @@ dnl Test if --enable-timestamp is explicitely enabled and make an error if this
AS_IF([test "x$enable_timestamp" = "xyes" -a "x$have_so_timestamp" = "xno"], [
AC_MSG_ERROR([--enable-timestamp not supported on this platform])
])
AS_IF([test "x$only_clock_realtime" = "xyes"], [AC_DEFINE(ONLY_CLOCK_REALTIME, [1], [ONLY_CLOCK_REALTIME is defined])])

AC_ARG_ENABLE([safe-limits],
AS_HELP_STRING([--enable-safe-limits], [Restrict timing parameters (-i, -p) within "safe" limits]))
Expand Down
2 changes: 1 addition & 1 deletion src/fping.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extern int h_errno;

/*** Constants ***/

#if HAVE_SO_TIMESTAMPNS
#if HAVE_SO_TIMESTAMPNS ^ ONLY_CLOCK_REALTIME
#define CLOCKID CLOCK_REALTIME
#endif

Expand Down

0 comments on commit 2d8d292

Please sign in to comment.