Skip to content

Commit

Permalink
Merge pull request #151 from kolyshkin/readlink-win
Browse files Browse the repository at this point in the history
Remove Windows' Readlink fork
  • Loading branch information
crosbymichael authored Apr 13, 2020
2 parents 0f16d7a + 643e66e commit d3ef23f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 281 deletions.
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.

0 comments on commit d3ef23f

Please sign in to comment.