Windows: Fix handling of changes to time zone.
Used to work but was broken in version 7.20181031, specifically commit
5ab0f48ffb
.
That this was not noticed over at least 1 daylight savings time zone
changes makes me wonder if the TSDelta stuff is still needed.
Perhaps the mtime on Windows no longer changes when the time zone is changed?
This commit is contained in:
parent
89bdcffdfa
commit
09ee6b0ccb
2 changed files with 5 additions and 5 deletions
|
@ -190,16 +190,14 @@ genInodeCache f delta = catchDefaultIO Nothing $
|
|||
toInodeCache :: TSDelta -> FilePath -> FileStatus -> IO (Maybe InodeCache)
|
||||
toInodeCache (TSDelta getdelta) f s
|
||||
| isRegularFile s = do
|
||||
#ifndef mingw32_HOST_OS
|
||||
delta <- getdelta
|
||||
#endif
|
||||
sz <- getFileSize' f s
|
||||
#ifdef mingw32_HOST_OS
|
||||
mtime <- MTimeHighRes . utcTimeToPOSIXSeconds <$> getModificationTime f
|
||||
mtime <- utcTimeToPOSIXSeconds <$> getModificationTime f
|
||||
#else
|
||||
let mtime = (MTimeHighRes (modificationTimeHiRes s + highResTime delta))
|
||||
let mtime = modificationTimeHiRes s
|
||||
#endif
|
||||
return $ Just $ InodeCache $ InodeCachePrim (fileID s) sz mtime
|
||||
return $ Just $ InodeCache $ InodeCachePrim (fileID s) sz (MTimeHighRes (mtime + highResTime delta))
|
||||
| otherwise = pure Nothing
|
||||
|
||||
{- Some filesystem get new random inodes each time they are mounted.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue