mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -04:00
go.sys/unix: fix creds_test.go
For this particular system call, which uses the net package, the expected error is syscall.EPERM not unix.EPERM. With this change, go test passes on my linux. LGTM=iant, rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/125270043
This commit is contained in:
+2
-1
@@ -10,6 +10,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.google.com/p/go.sys/unix"
|
"code.google.com/p/go.sys/unix"
|
||||||
@@ -57,7 +58,7 @@ func TestSCMCredentials(t *testing.T) {
|
|||||||
ucred.Gid = 0
|
ucred.Gid = 0
|
||||||
oob := unix.UnixCredentials(&ucred)
|
oob := unix.UnixCredentials(&ucred)
|
||||||
_, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)
|
_, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)
|
||||||
if err.(*net.OpError).Err != unix.EPERM {
|
if err.(*net.OpError).Err != syscall.EPERM {
|
||||||
t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err)
|
t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user