From: Juanma Barranquero Date: Fri, 3 Nov 2006 16:24:53 +0000 (+0000) Subject: (initialize_sockets): Don't initialize Winsock more than once. X-Git-Tag: emacs-pretest-22.0.91~366 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5796dab79d3da052f4916a2c37d20c32775184f0;p=emacs.git (initialize_sockets): Don't initialize Winsock more than once. --- 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 */