commit
ee51fa4e2993ab71339e29691aec8b924c810c53
Author: Frode Isaksen <frode.isaksen@bewan.com>
Date: Thu Aug 18 16:40:58 2011 +0300
su: fix su_time() on 64-bit OS X
The field tv_sec in struct timeval is 64bits instead of 32bits as in
su_time_t, so you cannot cast su_time_t to struct timeval.
-Fri Feb 21 16:38:32 EST 2014
+Wed Mar 5 10:25:31 CST 2014
ltv.tv_usec = ctv.tv_nsec / 1000;
}
#elif HAVE_GETTIMEOFDAY
-
- gettimeofday((struct timeval *)<v, NULL);
- ltv.tv_sec += NTP_EPOCH;
-
+ struct timeval tmp_tv = {0,0};
+ gettimeofday(&tmp_tv, NULL);
+ ltv.tv_sec = tmp_tv.tv_sec + NTP_EPOCH;
+ ltv.tv_usec = (unsigned long)tmp_tv.tv_usec;
#elif HAVE_FILETIME
GetSystemTimeAsFileTime(date.ft);