Merge pull request #1478 from estesp/freebsd-compile

Fix FreeBSD compilation
This commit is contained in:
Michael Crosby 2017-09-06 15:03:49 -04:00 committed by GitHub
commit 843b35c9f2
2 changed files with 3 additions and 4 deletions

View File

@ -123,7 +123,7 @@ func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
func getxattr(path, attr string) ([]byte, error) {
b, err := sysx.LGetxattr(path, attr)
if err == unix.ENOTSUP || err == unix.ENODATA {
if err == unix.ENOTSUP || err == sysx.ENODATA {
return nil, nil
}
return b, err

View File

@ -11,7 +11,6 @@ import (
"github.com/containerd/continuity/sysx"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
// whiteouts are files with a special meaning for the layered filesystem.
@ -84,11 +83,11 @@ func compareSysStat(s1, s2 interface{}) (bool, error) {
func compareCapabilities(p1, p2 string) (bool, error) {
c1, err := sysx.LGetxattr(p1, "security.capability")
if err != nil && err != unix.ENODATA {
if err != nil && err != sysx.ENODATA {
return false, errors.Wrapf(err, "failed to get xattr for %s", p1)
}
c2, err := sysx.LGetxattr(p2, "security.capability")
if err != nil && err != unix.ENODATA {
if err != nil && err != sysx.ENODATA {
return false, errors.Wrapf(err, "failed to get xattr for %s", p2)
}
return bytes.Equal(c1, c2), nil