containerd / continuity

A transport-agnostic, filesystem metadata manifest system
https://containerd.io
Apache License 2.0
138 stars 66 forks source link

syscallx: use golang.org/x/sys #149

Closed zhsj closed 4 years ago

zhsj commented 4 years ago

use Readlink from golang.org/x/sys/{unix,windows}

syscall_unix.go is also changed because golang.org/x/sys is preferred than syscall package.

estesp commented 4 years ago

Given this will no longer use the syscall import, I think it might be better to delete these files/this directory and move the call to sys/unix.Readlink into the sysx directory (where it is being used from file_posix.go); I guess you would need to create 2 files there given there is windows support, but maybe a readlink_unix.go and a readlink_windows.go in that directory with the calls to sys/unix and sys/windows respectively. I think this directory was temporary while the syscall itself was implemented for Windows before going upstream.

zhsj commented 4 years ago

I read the code again, I find the duplicated Readlink on windows is intentional. So let's close this PR.

113

zhsj commented 4 years ago

Although @darstahl said the fork of Readlink was temporary, but I didn't find upstream commits addressing any bug. So maybe this is still not upstream yet.