aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-13 12:15:17 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-13 12:16:17 -0700
commit1b430e82f12dede5a46ef78ac9b5d26c8a9231a7 (patch)
treef8c85cc6edf9c378d353d71e01562927d07a5ef4
parent3a580ae596baaf743797e04340dc1e31c34707f9 (diff)
downloadgrv-1b430e82f12dede5a46ef78ac9b5d26c8a9231a7.tar.gz
grv-1b430e82f12dede5a46ef78ac9b5d26c8a9231a7.tar.xz
grv-1b430e82f12dede5a46ef78ac9b5d26c8a9231a7.zip
netopen.c: winsock: type of _open_osfhandle() has changed?
-rw-r--r--netopen.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/netopen.c b/netopen.c
index 0e72fdb..71486c1 100644
--- a/netopen.c
+++ b/netopen.c
@@ -11,11 +11,11 @@
#ifdef __WIN32__
#define _WIN32_WINNT 0x0501 /* Windows XP */
+#include <winsock2.h>
#include <windows.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
-#include <winsock2.h>
#include <ws2tcpip.h>
static int winsock_started = 0;
@@ -43,9 +43,8 @@ static FILE *sock_to_file(SOCKET sock, int is_write)
{
FILE *f;
int fd;
- int osfhandle = sock;
- fd = _open_osfhandle(&osfhandle, is_write ? 0 : _O_RDONLY);
+ fd = _open_osfhandle(sock, is_write ? 0 : _O_RDONLY);
if (fd < 0) {
closesocket(sock);
return NULL;