mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
unix: check error return of os.Symlink in tests on Linux
Change-Id: Iddb6fbcb0f0f834fa9fd7ef95d57aa8c7b4007fd Reviewed-on: https://go-review.googlesource.com/87575 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
810d700034
commit
52ba35ddf9
@@ -20,9 +20,12 @@ func TestFchmodat(t *testing.T) {
|
||||
defer chtmpdir(t)()
|
||||
|
||||
touch(t, "file1")
|
||||
os.Symlink("file1", "symlink1")
|
||||
err := os.Symlink("file1", "symlink1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err := unix.Fchmodat(unix.AT_FDCWD, "symlink1", 0444, 0)
|
||||
err = unix.Fchmodat(unix.AT_FDCWD, "symlink1", 0444, 0)
|
||||
if err != nil {
|
||||
t.Fatalf("Fchmodat: unexpected error: %v", err)
|
||||
}
|
||||
@@ -239,7 +242,10 @@ func TestFstatat(t *testing.T) {
|
||||
t.Errorf("Fstatat: returned stat does not match Stat")
|
||||
}
|
||||
|
||||
os.Symlink("file1", "symlink1")
|
||||
err = os.Symlink("file1", "symlink1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = unix.Lstat("symlink1", &st1)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user