Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Windows' Readlink fork #151

Merged
merged 3 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ language: go
sudo: required

go:
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x
- tip

go_import_path: github.com/containerd/continuity
Expand Down
4 changes: 4 additions & 0 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func (d *driver) Lstat(p string) (os.FileInfo, error) {
return os.Lstat(p)
}

func (d *driver) Readlink(p string) (string, error) {
return os.Readlink(p)
}

func (d *driver) Mkdir(p string, mode os.FileMode) error {
return os.Mkdir(p, mode)
}
Expand Down
5 changes: 0 additions & 5 deletions driver/driver_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,3 @@ func (d *driver) LSetxattr(path string, attrMap map[string][]byte) error {
func (d *driver) DeviceInfo(fi os.FileInfo) (maj uint64, min uint64, err error) {
return devices.DeviceInfo(fi)
}

// Readlink was forked on Windows to fix a Golang bug, use the "os" package here
func (d *driver) Readlink(p string) (string, error) {
return os.Readlink(p)
}
14 changes: 6 additions & 8 deletions driver/driver_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
limitations under the License.
*/

// +build go1.13

// Go 1.13 is the minimally supported version for Windows.
// Earlier golang releases have bug in os.Readlink
// (see https://github.com/golang/go/issues/30463).

package driver

import (
"os"

"github.com/containerd/continuity/sysx"
)

func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
Expand All @@ -35,9 +39,3 @@ func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
// TODO: Use Window's equivalent
return os.Chmod(path, mode)
}

// Readlink is forked in order to support Volume paths which are used
// in container layers.
func (d *driver) Readlink(p string) (string, error) {
return sysx.Readlink(p)
}
26 changes: 0 additions & 26 deletions syscallx/syscall_unix.go

This file was deleted.

112 changes: 0 additions & 112 deletions syscallx/syscall_windows.go

This file was deleted.

128 changes: 0 additions & 128 deletions sysx/file_posix.go

This file was deleted.