From 5796dab79d3da052f4916a2c37d20c32775184f0 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 3 Nov 2006 16:24:53 +0000 Subject: [PATCH] (initialize_sockets): Don't initialize Winsock more than once. --- lib-src/emacsclient.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index bede01aaa0b..af7c10cac7d 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -390,8 +390,11 @@ void __cdecl close_winsock () void initialize_sockets () { + static done = FALSE; WSADATA wsaData; + if (done) return; + /* Initialize the WinSock2 library. */ if (WSAStartup (MAKEWORD (2, 0), &wsaData)) { @@ -400,6 +403,7 @@ void initialize_sockets () } atexit (close_winsock); + done = TRUE; } #endif /* WINDOWSNT */ -- 2.39.2