From ac73e9fd8988dfd87a86849835564a3eeebf96f0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 20 Apr 2021 09:28:29 +0200 Subject: [PATCH] unix: fix TestSCMCredentials after CL 272226 After CL 42765 (*net.UnixConn).ReadMsgUnix returns flags with MSG_CMSG_CLOEXEC set. Adjust TestSCMCredentials accordingly. Change-Id: Id7da35bbd94c51433f5f27a0e04827795826c02e Reviewed-on: https://go-review.googlesource.com/c/sys/+/311390 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- unix/creds_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/creds_test.go b/unix/creds_test.go index a1928456..483bfb1f 100644 --- a/unix/creds_test.go +++ b/unix/creds_test.go @@ -89,8 +89,8 @@ func TestSCMCredentials(t *testing.T) { if err != nil { t.Fatalf("ReadMsgUnix: %v", err) } - if flags != 0 { - t.Fatalf("ReadMsgUnix flags = 0x%x, want 0", flags) + if flags != 0 && flags != unix.MSG_CMSG_CLOEXEC { + t.Fatalf("ReadMsgUnix flags = %#x, want 0 or %#x (MSG_CMSG_CLOEXEC)", flags, unix.MSG_CMSG_CLOEXEC) } if n != tt.dataLen { t.Fatalf("ReadMsgUnix n = %d, want %d", n, tt.dataLen)