diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | misc.c | 4 |
3 files changed, 11 insertions, 2 deletions
@@ -54,6 +54,8 @@ | |||
54 | openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/port-aix.c | 54 | openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/port-aix.c |
55 | openbsd-compat/port-linux.c] Replace portable-specific instances of xfree | 55 | openbsd-compat/port-linux.c] Replace portable-specific instances of xfree |
56 | with the equivalent calls to free. | 56 | with the equivalent calls to free. |
57 | - (dtucker) [configure.ac misc.c] Look for clock_gettime in librt and fall | ||
58 | back to time(NULL) if we can't find it anywhere. | ||
57 | 59 | ||
58 | 20130529 | 60 | 20130529 |
59 | - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null | 61 | - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null |
diff --git a/configure.ac b/configure.ac index d35a19bcc..1b64d11ae 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.527 2013/06/01 21:18:48 dtucker Exp $ | 1 | # $Id: configure.ac,v 1.528 2013/06/01 22:18:32 dtucker Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -15,7 +15,7 @@ | |||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | ||
17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
18 | AC_REVISION($Revision: 1.527 $) | 18 | AC_REVISION($Revision: 1.528 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | AC_LANG([C]) | 20 | AC_LANG([C]) |
21 | 21 | ||
@@ -1648,6 +1648,9 @@ const char *gai_strerror(int); | |||
1648 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], | 1648 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
1649 | [Some systems put nanosleep outside of libc])]) | 1649 | [Some systems put nanosleep outside of libc])]) |
1650 | 1650 | ||
1651 | AC_SEARCH_LIBS([clock_gettime], [rt], | ||
1652 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) | ||
1653 | |||
1651 | dnl Make sure prototypes are defined for these before using them. | 1654 | dnl Make sure prototypes are defined for these before using them. |
1652 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) | 1655 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
1653 | AC_CHECK_DECL([strsep], | 1656 | AC_CHECK_DECL([strsep], |
@@ -857,12 +857,16 @@ ms_to_timeval(struct timeval *tv, int ms) | |||
857 | time_t | 857 | time_t |
858 | monotime(void) | 858 | monotime(void) |
859 | { | 859 | { |
860 | #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) | ||
860 | struct timespec ts; | 861 | struct timespec ts; |
861 | 862 | ||
862 | if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) | 863 | if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) |
863 | fatal("clock_gettime: %s", strerror(errno)); | 864 | fatal("clock_gettime: %s", strerror(errno)); |
864 | 865 | ||
865 | return (ts.tv_sec); | 866 | return (ts.tv_sec); |
867 | #else | ||
868 | return time(NULL); | ||
869 | #endif | ||
866 | } | 870 | } |
867 | 871 | ||
868 | void | 872 | void |