diff options
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 943202f41..49dcd89d8 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -308,11 +308,6 @@ static inline long long filetime_to_hnsec(const FILETIME *ft) | |||
308 | return winTime - 116444736000000000LL; | 308 | return winTime - 116444736000000000LL; |
309 | } | 309 | } |
310 | 310 | ||
311 | static inline time_t filetime_to_time_t(const FILETIME *ft) | ||
312 | { | ||
313 | return (time_t)(filetime_to_hnsec(ft) / 10000000); | ||
314 | } | ||
315 | |||
316 | static inline struct timespec filetime_to_timespec(const FILETIME *ft) | 311 | static inline struct timespec filetime_to_timespec(const FILETIME *ft) |
317 | { | 312 | { |
318 | struct timespec ts; | 313 | struct timespec ts; |
@@ -738,14 +733,15 @@ int mingw_fstat(int fd, struct mingw_stat *buf) | |||
738 | 733 | ||
739 | static inline void timeval_to_filetime(const struct timeval tv, FILETIME *ft) | 734 | static inline void timeval_to_filetime(const struct timeval tv, FILETIME *ft) |
740 | { | 735 | { |
741 | long long winTime = ((tv.tv_sec * 1000000LL) + tv.tv_usec) * 10LL + 116444736000000000LL; | 736 | long long winTime = tv.tv_sec * 10000000LL + tv.tv_usec * 10LL + |
737 | 116444736000000000LL; | ||
742 | ft->dwLowDateTime = winTime; | 738 | ft->dwLowDateTime = winTime; |
743 | ft->dwHighDateTime = winTime >> 32; | 739 | ft->dwHighDateTime = winTime >> 32; |
744 | } | 740 | } |
745 | 741 | ||
746 | static inline void timespec_to_filetime(const struct timespec tv, FILETIME *ft) | 742 | static inline void timespec_to_filetime(const struct timespec tv, FILETIME *ft) |
747 | { | 743 | { |
748 | long long winTime = (tv.tv_sec * 10000000LL) + tv.tv_nsec / 100LL + | 744 | long long winTime = tv.tv_sec * 10000000LL + tv.tv_nsec / 100LL + |
749 | 116444736000000000LL; | 745 | 116444736000000000LL; |
750 | ft->dwLowDateTime = winTime; | 746 | ft->dwLowDateTime = winTime; |
751 | ft->dwHighDateTime = winTime >> 32; | 747 | ft->dwHighDateTime = winTime >> 32; |