Extract mknod, umask, lstat to pkg/system
Some parts of pkg/archive is called on both client/daemon code. To get it compiling on Windows, these funcs are extracted into files with build tags. Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
This commit is contained in:
parent
91ea04eea7
commit
515e7481de
9 changed files with 89 additions and 9 deletions
|
@ -269,6 +269,14 @@ func newRootFileInfo() *FileInfo {
|
|||
return root
|
||||
}
|
||||
|
||||
func lstat(path string) (*stat, error) {
|
||||
s, err := system.Lstat(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fromStatT(s), nil
|
||||
}
|
||||
|
||||
func collectFileInfo(sourceDir string) (*FileInfo, error) {
|
||||
root := newRootFileInfo()
|
||||
|
||||
|
@ -299,9 +307,11 @@ func collectFileInfo(sourceDir string) (*FileInfo, error) {
|
|||
parent: parent,
|
||||
}
|
||||
|
||||
if err := syscall.Lstat(path, &info.stat); err != nil {
|
||||
s, err := lstat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info.stat = s
|
||||
|
||||
info.capability, _ = system.Lgetxattr(path, "security.capability")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue