]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix vet warning in UnixRights
authorMatthew Dempsky <mdempsky@google.com>
Thu, 8 Oct 2015 19:43:57 +0000 (12:43 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 8 Oct 2015 20:10:16 +0000 (20:10 +0000)
Change-Id: Ic19c94fe0af55e17f6c2fcfd36085ccb1584da6f
Reviewed-on: https://go-review.googlesource.com/15608
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/syscall/sockcmsg_unix.go

index 045a012c05bd3a0a65636a4891d6cf7e17c07e02..47242752f08fe3e99f25da44c0c5082f426bef68 100644 (file)
@@ -77,10 +77,10 @@ func UnixRights(fds ...int) []byte {
        h.Level = SOL_SOCKET
        h.Type = SCM_RIGHTS
        h.SetLen(CmsgLen(datalen))
-       data := uintptr(cmsgData(h))
+       data := cmsgData(h)
        for _, fd := range fds {
-               *(*int32)(unsafe.Pointer(data)) = int32(fd)
-               data += 4
+               *(*int32)(data) = int32(fd)
+               data = unsafe.Pointer(uintptr(data) + 4)
        }
        return b
 }