From 4a0dcc2de115d779b48a0acd1d6b8c9b4c24c307 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Mon, 23 Oct 2017 17:27:34 +1100 Subject: [PATCH] runtime: make errno positive in netpollopen Make netpollopen return what Windows GetLastError API returns. It is probably copy / paste error from long time ago. Change-Id: I28f78718c15fef3e8b5f5d11a259533d7e9c6185 Reviewed-on: https://go-review.googlesource.com/72592 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/runtime/netpoll_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/netpoll_windows.go b/src/runtime/netpoll_windows.go index 79dafb02796..134071f5e3c 100644 --- a/src/runtime/netpoll_windows.go +++ b/src/runtime/netpoll_windows.go @@ -47,7 +47,7 @@ func netpolldescriptor() uintptr { func netpollopen(fd uintptr, pd *pollDesc) int32 { if stdcall4(_CreateIoCompletionPort, fd, iocphandle, 0, 0) == 0 { - return -int32(getlasterror()) + return int32(getlasterror()) } return 0 }