aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/util.c5
-rw-r--r--src/common/util.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d7f8e45cb..21cb010b3 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -808,7 +808,10 @@ void tor_gettimeofday(struct timeval *timeval) {
exit(1);
}
#elif defined(HAVE_FTIME)
- ftime(timeval);
+ struct timeb tb;
+ ftime(&tb);
+ timeval->tv_sec = tb.time;
+ timeval->tv_usec = tb.millitm * 1000;
#else
#error "No way to get time."
#endif
diff --git a/src/common/util.h b/src/common/util.h
index 51a544005..0cc08e9a1 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -30,9 +30,10 @@
#ifdef HAVE_FTIME
#define USING_FAKE_TIMEVAL
#include <sys/timeb.h>
-#define timeval timeb
-#define tv_sec time
-#define tv_usec millitm
+struct timeval {
+ time_t tv_sec;
+ unsigned int tv_usec;
+};
#endif
#endif