X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsocket.c;h=dcbd07af6c78fec4a2a1c158c5e6cea8dc55e9ee;hb=4ec4a8e6d91a7247cf7d5b819572026ef5e654c3;hp=1fa6928747c2e71eb074bca14fc207e46805ec2a;hpb=dbd243d0795137dc4877821dfb3d292fe80bcc5f;p=gnulib.git diff --git a/lib/socket.c b/lib/socket.c index 1fa692874..dcbd07af6 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -1,6 +1,6 @@ /* socket.c --- wrappers for Windows socket function - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,12 +26,18 @@ /* Get set_winsock_errno, FD_TO_SOCKET etc. */ #include "w32sock.h" +#include "sockets.h" + int rpl_socket (int domain, int type, int protocol) { + SOCKET fh; + + gl_sockets_startup (SOCKETS_1_1); + /* We have to use WSASocket() to create non-overlapped IO sockets. Overlapped IO sockets cannot be used with read/write. */ - SOCKET fh = WSASocket (domain, type, protocol, NULL, 0, 0); + fh = WSASocket (domain, type, protocol, NULL, 0, 0); if (fh == INVALID_SOCKET) {