提交 64f7a646 编写于 作者: A alanb

6819689: File.lastModified can return bogus value for remote file accessed as...

6819689: File.lastModified can return bogus value for remote file accessed as it is being deleted [win]
Reviewed-by: sherman
Contributed-by: andreas.frischknecht@softwired-inc.com
上级 aa97329a
...@@ -309,13 +309,14 @@ Java_java_io_WinNTFileSystem_getLastModifiedTime(JNIEnv *env, jobject this, ...@@ -309,13 +309,14 @@ Java_java_io_WinNTFileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
/* No template file */ /* No template file */
NULL); NULL);
if (h != INVALID_HANDLE_VALUE) { if (h != INVALID_HANDLE_VALUE) {
GetFileTime(h, NULL, NULL, &t); if (GetFileTime(h, NULL, NULL, &t)) {
CloseHandle(h);
modTime.LowPart = (DWORD) t.dwLowDateTime; modTime.LowPart = (DWORD) t.dwLowDateTime;
modTime.HighPart = (LONG) t.dwHighDateTime; modTime.HighPart = (LONG) t.dwHighDateTime;
rv = modTime.QuadPart / 10000; rv = modTime.QuadPart / 10000;
rv -= 11644473600000; rv -= 11644473600000;
} }
CloseHandle(h);
}
free(pathbuf); free(pathbuf);
return rv; return rv;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册