Update vendored library github.com/pkg/xattr
This commit is contained in:
parent
19035e977b
commit
75946e7c58
9 changed files with 48 additions and 11 deletions
12
vendor/github.com/pkg/xattr/xattr_linux.go
generated
vendored
12
vendor/github.com/pkg/xattr/xattr_linux.go
generated
vendored
|
@ -32,7 +32,9 @@ func List(path string) ([]string, error) {
|
|||
return nil, &Error{"xattr.List", path, "", err}
|
||||
}
|
||||
if size > 0 {
|
||||
buf := make([]byte, size)
|
||||
// `size + 1` because of ERANGE error when reading
|
||||
// from a SMB1 mount point (https://github.com/pkg/xattr/issues/16).
|
||||
buf := make([]byte, size+1)
|
||||
// Read into buffer of that size.
|
||||
read, err := syscall.Listxattr(path, buf)
|
||||
if err != nil {
|
||||
|
@ -59,3 +61,11 @@ func Remove(path, name string) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Supported checks if filesystem supports extended attributes
|
||||
func Supported(path string) bool {
|
||||
if _, err := syscall.Listxattr(path, nil); err != nil {
|
||||
return err != syscall.ENOTSUP
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue