mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
unix: fix TestXattr on android
Like on linux, lsetxattr on symlinks returns EPERM. Change-Id: I6dfc59484e1826872af54579dd6ec02705c816da Reviewed-on: https://go-review.googlesource.com/114535 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
04b83988a0
commit
b269ba27ed
@@ -108,11 +108,12 @@ func TestXattr(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Linux doesn't support xattrs on symlink according to xattr(7), so
|
||||
// just test that we get the proper errors.
|
||||
|
||||
err = unix.Lsetxattr(s, xattrName, []byte(xattrDataSet), 0)
|
||||
if err != nil && (runtime.GOOS != "linux" || err != unix.EPERM) {
|
||||
t.Fatalf("Lsetxattr: %v", err)
|
||||
if err != nil {
|
||||
// Linux and Android doen't support xattrs on symlinks according
|
||||
// to xattr(7), so just test that we get the proper error.
|
||||
if (runtime.GOOS != "linux" && runtime.GOOS != "android") || err != unix.EPERM {
|
||||
t.Fatalf("Lsetxattr: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user