Skip to content

Commit

Permalink
Increase epsilon, add temporary debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
23Skidoo committed Jan 16, 2017
1 parent 976265c commit 05aaaa5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cabal/Distribution/Compat/Time.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import Distribution.Compat.Prelude

import System.Directory ( getModificationTime )

import Distribution.Simple.Utils ( withTempDirectory )
import Distribution.Verbosity ( silent )
import Distribution.Simple.Utils ( debug, withTempDirectory )
import Distribution.Verbosity ( deafening, silent )

import System.FilePath

Expand Down Expand Up @@ -193,10 +193,11 @@ calibrateMtimeChangeDelay =
sampleMtimes :: FilePath -> IO [Int]
sampleMtimes fileName = do
mtime0 <- sampleMtime 1 fileName
debug deafening $ "mtime0: " ++ show mtime0
-- Some filesystems (e.g. HFS+ on Mac) store mtimes with 1
-- second resolution. Bail out directly instead of spinning in
-- that case.
if (mtime0 >= 1000000) || (1000000 - mtime0 <= 10000)
if (mtime0 >= 1000000) || (1000000 - mtime0 <= 100000)
then return [mtime0]
else do mtimes <- for [2..25] $ \(i::Int) -> sampleMtime i fileName
return (mtime0:mtimes)
Expand Down

0 comments on commit 05aaaa5

Please sign in to comment.