]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make errno positive in netpollopen
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 23 Oct 2017 06:27:34 +0000 (17:27 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Tue, 24 Oct 2017 03:19:09 +0000 (03:19 +0000)
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 <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

src/runtime/netpoll_windows.go

index 79dafb0279656afa63f2721e7d5506e9fa60211a..134071f5e3ca178728d8ec9314c98f1509872552 100644 (file)
@@ -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
 }