Commit 3dec8fc7 authored by Ian Lance Taylor's avatar Ian Lance Taylor

unix: fix TestSCMCredentials

Port http://golang.org/cl/9714 from the main syscall package.

Change-Id: I85e3f119777b0e1f52dfd10365fd30c900120dc2
Reviewed-on: https://go-review.googlesource.com/9961Reviewed-by: 's avatarMinux Ma <minux@golang.org>
parent b65462c9
......@@ -58,7 +58,13 @@ func TestSCMCredentials(t *testing.T) {
ucred.Gid = 0
oob := unix.UnixCredentials(&ucred)
_, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)
if err.(*net.OpError).Err != syscall.EPERM {
if op, ok := err.(*net.OpError); ok {
err = op.Err
}
if sys, ok := err.(*os.SyscallError); ok {
err = sys.Err
}
if err != syscall.EPERM {
t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err)
}
}
......
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