summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index ce194bb40d..1beb79d2c6 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3301,6 +3301,7 @@ unixtime_to_filetime(time_t time, FILETIME *ft)
{
struct tm *tm;
SYSTEMTIME st;
+ FILETIME lt;
tm = gmtime(&time);
st.wYear = tm->tm_year + 1900;
@@ -3311,7 +3312,8 @@ unixtime_to_filetime(time_t time, FILETIME *ft)
st.wMinute = tm->tm_min;
st.wSecond = tm->tm_sec;
st.wMilliseconds = 0;
- if (!SystemTimeToFileTime(&st, ft)) {
+ if (!SystemTimeToFileTime(&st, &lt) ||
+ !LocalFileTimeToFileTime(&lt, ft)) {
errno = map_errno(GetLastError());
return -1;
}