windows: fix recvfrom and sendto data types#51
windows: fix recvfrom and sendto data types#51maltalex wants to merge 1 commit intogolang:masterfrom maltalex:type_fix
Conversation
|
This PR (HEAD: 9aad4c3) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/sys/+/211998 to see it. Tip: You can toggle comments from me using the |
|
Message from Ian Lance Taylor: Patch Set 1: Run-TryBot+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/211998. |
|
Message from Gobot Gobot: Patch Set 1: TryBots beginning. Status page: https://farmer.golang.org/try?commit=00fe2ab7 Please don’t reply on this GitHub thread. Visit golang.org/cl/211998. |
|
Message from Gobot Gobot: Patch Set 1: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/211998. |
|
Message from Alex Maltinsky: Patch Set 3: (2 comments) Rephrased commit message. Please don’t reply on this GitHub thread. Visit golang.org/cl/211998. |
Fixes wrong data type used in Windows recvfrom and sendto calls In Windows, `int` refers to a 32-bit signed integer (https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#int). However, the current implementation (https://golang.org/cl/208321) uses the `int` type, which can have a different size. This is especially important when recvfrom` returns a 32bit value of `-1`, indicating an error, since it is interpreted as the 64bit value 4294967295. Change-Id: Ib966ff317b0be7e29e48ee373a794cd0267fb007 GitHub-Last-Rev: 9aad4c3 GitHub-Pull-Request: #51 Reviewed-on: https://go-review.googlesource.com/c/sys/+/211998 Reviewed-by: Ian Lance Taylor <iant@golang.org>
|
Message from Ian Lance Taylor: Patch Set 3: Code-Review+2 Thanks. Please don’t reply on this GitHub thread. Visit golang.org/cl/211998. |
|
This PR is being closed because golang.org/cl/211998 has been merged. |
Fixes wrong data type used in Windows recvfrom and sendto calls
In Windows,
intrefers to a 32-bit signed integer(https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#int).
However, the current implementation (https://golang.org/cl/208321)
uses the
inttype, which can have a different size. This is especiallyimportant when recvfrom
returns a 32bit value of-1`, indicating an error,since it is interpreted as the 64bit value 4294967295.