mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
When faking gettimeofday with ftime, do it right.
svn:r2068
This commit is contained in:
parent
2a339b7627
commit
06c11a61ce
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user