From: Joel Sing Date: Mon, 6 Jan 2020 17:31:23 +0000 (+1100) Subject: runtime: correct setNonblock on linux/arm64 X-Git-Tag: go1.14rc1~158 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=edf3ec987ff51584c3bfdaeef7d0a24646d0fb4b;p=gostls13.git runtime: correct setNonblock on linux/arm64 The current code uses EOR (exclusive OR), which will result in the O_NONBLOCK flag being toggled rather than being set. Other implementations use OR, hence this is likely a bug. Change-Id: I5dafa9c572452070bd37789c8a731ad6d04a86cd Reviewed-on: https://go-review.googlesource.com/c/go/+/212766 Run-TryBot: Ian Lance Taylor Reviewed-by: Cherry Zhang Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s index 8a0f06f206..8c2a249c9f 100644 --- a/src/runtime/sys_linux_arm64.s +++ b/src/runtime/sys_linux_arm64.s @@ -688,7 +688,7 @@ TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4 MOVD $SYS_fcntl, R8 SVC MOVD $0x800, R2 // O_NONBLOCK - EOR R0, R2 + ORR R0, R2 MOVW fd+0(FP), R0 // fd MOVD $4, R1 // F_SETFL MOVD $SYS_fcntl, R8