summaryrefslogtreecommitdiffstats
path: root/src/win/winsock.c
diff options
context:
space:
mode:
authorlibuv upstream <libuv@googlegroups.com>2019-06-10 13:17:21 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-18 11:45:34 (GMT)
commitb4069b04ff63b327ff4881282200c3c73fded34d (patch)
treef1c97b98e2253ec8e4a9b75ee2f8f99426e9b2f6 /src/win/winsock.c
parent4fcb0d0213112bb2fdb04bb27e82543b93cfe41d (diff)
downloadCMake-b4069b04ff63b327ff4881282200c3c73fded34d.zip
CMake-b4069b04ff63b327ff4881282200c3c73fded34d.tar.gz
CMake-b4069b04ff63b327ff4881282200c3c73fded34d.tar.bz2
libuv 2019-06-10 (ee24ce90)
Code extracted from: https://github.com/libuv/libuv.git at commit ee24ce900e5714c950b248da2bdd311b01c983be (v1.x).
Diffstat (limited to 'src/win/winsock.c')
-rw-r--r--src/win/winsock.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/win/winsock.c b/src/win/winsock.c
index 5e7da2a..5820ba9 100644
--- a/src/win/winsock.c
+++ b/src/win/winsock.c
@@ -87,12 +87,6 @@ void uv_winsock_init(void) {
WSAPROTOCOL_INFOW protocol_info;
int opt_len;
- /* Initialize winsock */
- errorno = WSAStartup(MAKEWORD(2, 2), &wsa_data);
- if (errorno != 0) {
- uv_fatal_error(errorno, "WSAStartup");
- }
-
/* Set implicit binding address used by connectEx */
if (uv_ip4_addr("0.0.0.0", 0, &uv_addr_ip4_any_)) {
abort();
@@ -102,6 +96,15 @@ void uv_winsock_init(void) {
abort();
}
+ /* Skip initialization in safe mode without network support */
+ if (1 == GetSystemMetrics(SM_CLEANBOOT)) return;
+
+ /* Initialize winsock */
+ errorno = WSAStartup(MAKEWORD(2, 2), &wsa_data);
+ if (errorno != 0) {
+ uv_fatal_error(errorno, "WSAStartup");
+ }
+
/* Detect non-IFS LSPs */
dummy = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);