summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-22 16:36:46 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-22 16:36:46 +0000
commit9c51cf4c9382ec7949cbce7b5d3babf8d5581e4d (patch)
tree16e283205582e75e1fb852b5e7f0bf205f94f0c7 /win32
parent5d4fa709c52c313242d8c99c393f00bdcd687712 (diff)
downloadperl-9c51cf4c9382ec7949cbce7b5d3babf8d5581e4d.tar.gz
win32_utime() on directories should use localtime() rather
than gmtime() (from Jan Dubois) p4raw-id: //depot/perl@4420
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 4f0d7f8cd6..1bfb6feaa0 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1296,14 +1296,13 @@ win32_times(struct tms *timebuf)
return 0;
}
-/* fix utime() so it works on directories in NT
- * thanks to Jan Dubois <jan.dubois@ibm.net>
- */
+/* fix utime() so it works on directories in NT */
static BOOL
filetime_from_time(PFILETIME pFileTime, time_t Time)
{
- struct tm *pTM = gmtime(&Time);
+ struct tm *pTM = localtime(&Time);
SYSTEMTIME SystemTime;
+ FILETIME LocalTime;
if (pTM == NULL)
return FALSE;
@@ -1316,7 +1315,8 @@ filetime_from_time(PFILETIME pFileTime, time_t Time)
SystemTime.wSecond = pTM->tm_sec;
SystemTime.wMilliseconds = 0;
- return SystemTimeToFileTime(&SystemTime, pFileTime);
+ return SystemTimeToFileTime(&SystemTime, &LocalTime) &&
+ LocalFileTimeToFileTime(&LocalTime, pFileTime);
}
DllExport int