]> Cypherpunks repositories - gostls13.git/commit
os: use Stat instead of Lstat in Symlink
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 26 Oct 2018 07:44:17 +0000 (18:44 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 31 Oct 2018 08:40:43 +0000 (08:40 +0000)
commit5cc80899486027db5f0de00870f1e022e1cfb9c5
tree63692f82b78efe5cf629258f7e3c1f4e5dd4121d
parentfde4b9ed14e339b5064373c1d4a73e211ec32ac4
os: use Stat instead of Lstat in Symlink

Windows implementation of Symlink uses CreateSymbolicLink Windows
API. The API requires to identify the target type: file or
directory. Current Symlink implementation  uses Lstat to determine
symlink type, but Lstat will not be able to determine correct
result if destination is symlink. Replace Lstat call with Stat.

Fixes #28432

Change-Id: Ibee6d8ac21e2246bf8d0a019c4c66d38b09887d4
Reviewed-on: https://go-review.googlesource.com/c/145217
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/file_windows.go
src/os/stat_test.go