Commit 52ba35dd authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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: 's avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 810d7000
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment