Skip to content

Commit 643e66e

Browse files
committed
Remove Windows' Readlink fork
This reverts the part of commit 8100e75 (PR #113) that added the fork of Readlink() for Windows. At that time the fork was done to work around the bug in golang's implementation of os.Readlink() for Windows. The above bug was never reported upstream, but fortunately it was independently found, reported [1], and fixed [2]. The fix made its way into go-1.13 (there is no mention of that in release notes, so I checked it in git history). [1] golang/go#30463 [2] https://go-review.googlesource.com/c/go/+/164201 Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent da42a30 commit 643e66e

6 files changed

Lines changed: 4 additions & 279 deletions

File tree

driver/driver.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ func (d *driver) Lstat(p string) (os.FileInfo, error) {
138138
return os.Lstat(p)
139139
}
140140

141+
func (d *driver) Readlink(p string) (string, error) {
142+
return os.Readlink(p)
143+
}
144+
141145
func (d *driver) Mkdir(p string, mode os.FileMode) error {
142146
return os.Mkdir(p, mode)
143147
}

driver/driver_unix.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,3 @@ func (d *driver) LSetxattr(path string, attrMap map[string][]byte) error {
131131
func (d *driver) DeviceInfo(fi os.FileInfo) (maj uint64, min uint64, err error) {
132132
return devices.DeviceInfo(fi)
133133
}
134-
135-
// Readlink was forked on Windows to fix a Golang bug, use the "os" package here
136-
func (d *driver) Readlink(p string) (string, error) {
137-
return os.Readlink(p)
138-
}

driver/driver_windows.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ package driver
2424

2525
import (
2626
"os"
27-
28-
"github.com/containerd/continuity/sysx"
2927
)
3028

3129
func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
@@ -41,9 +39,3 @@ func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
4139
// TODO: Use Window's equivalent
4240
return os.Chmod(path, mode)
4341
}
44-
45-
// Readlink is forked in order to support Volume paths which are used
46-
// in container layers.
47-
func (d *driver) Readlink(p string) (string, error) {
48-
return sysx.Readlink(p)
49-
}

syscallx/syscall_unix.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

syscallx/syscall_windows.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

sysx/file_posix.go

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)