summaryrefslogtreecommitdiff
path: root/file_io/win32
diff options
context:
space:
mode:
authorIvan Zhakov <ivan@apache.org>2022-06-18 13:36:42 +0000
committerIvan Zhakov <ivan@apache.org>2022-06-18 13:36:42 +0000
commit234757a0fb715bf31a729f6a3099c4c8a915e48f (patch)
tree33bf0d20e3a13a4c679240d6f9035738fb53e0d4 /file_io/win32
parenta8d5d20a99e73a1dc9b552d0901718d7f70ea216 (diff)
downloadapr-234757a0fb715bf31a729f6a3099c4c8a915e48f.tar.gz
On 1.8.x branch: Merge r1896623 from trunk:
Optimize apr_file_mtime_set() on Windows. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1902044 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/win32')
-rw-r--r--file_io/win32/filestat.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
index 5ddee7f29..17f271888 100644
--- a/file_io/win32/filestat.c
+++ b/file_io/win32/filestat.c
@@ -877,20 +877,11 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname,
APR_OS_DEFAULT, pool);
if (!rv)
{
- FILETIME file_ctime;
- FILETIME file_atime;
FILETIME file_mtime;
- if (!GetFileTime(thefile->filehand,
- &file_ctime, &file_atime, &file_mtime))
+ AprTimeToFileTime(&file_mtime, mtime);
+ if (!SetFileTime(thefile->filehand, NULL, NULL, &file_mtime))
rv = apr_get_os_error();
- else
- {
- AprTimeToFileTime(&file_mtime, mtime);
- if (!SetFileTime(thefile->filehand,
- &file_ctime, &file_atime, &file_mtime))
- rv = apr_get_os_error();
- }
apr_file_close(thefile);
}