]> Cypherpunks repositories - gostls13.git/commit
os: fix windows Lstat missing name for some files
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>
Sun, 17 Mar 2019 04:56:29 +0000 (11:56 +0700)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 20 Mar 2019 08:35:29 +0000 (08:35 +0000)
commit9e0e9ac5547a9cc5174cca79abaac0cdd3ec787e
treeb46a2bff3937d4a81b71ec807a39a517b26cc97c
parente0181ff52a17eeddd20b8560ce4abaa615388dd0
os: fix windows Lstat missing name for some files

On Windows, GetFileAttributesEx fails with ERROR_SHARING_VIOLATION for
some files, like c:\pagefile.sys. In this case,
newFileStatFromWin32finddata is used to fill file info, but it does not fill
name and path.

After getting file stat from newFileStatFromWin32finddata, just set file info
name and path before return fixes the issue.

Fixes #30883

Change-Id: I654e96c634e8a9bf5ce7e1aaa93968e88953620d
Reviewed-on: https://go-review.googlesource.com/c/go/+/167779
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/os/os_windows_test.go
src/os/stat_windows.go
src/os/types_windows.go