]> Cypherpunks.ru repositories - gostls13.git/commit
os: force consistent mtime before running fstest on directory on Windows
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 18 Jan 2021 14:23:16 +0000 (15:23 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 25 Jan 2021 15:12:58 +0000 (15:12 +0000)
commitff82cc971aabd113f3b79afb054e287c0d5c5c00
treed12628b05bde6dc936a11795ea1a48c2de303768
parent044f937a73dc9a28c36a6c87d55c2211247e7d63
os: force consistent mtime before running fstest on directory on Windows

FindFileNext sometimes returns a different mtime than looking at the
file directly, because the MFT on NTFS is written to lazily. In order to
keep these in sync, we use GetFileInformationByHandle to get the actual
mtime, and then write it back to the file explicitly.

Fixes #42637.

Change-Id: I774016d3ac55d0dc9b0f9c1b681516c33ba0d28a
Reviewed-on: https://go-review.googlesource.com/c/go/+/285720
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
src/os/os_test.go