]> git.eshelyaron.com Git - emacs.git/commitdiff
(initialize_sockets): Don't initialize Winsock more than once.
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 3 Nov 2006 16:24:53 +0000 (16:24 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 3 Nov 2006 16:24:53 +0000 (16:24 +0000)
lib-src/emacsclient.c

index bede01aaa0b9f0f78b6f4bb2f817a65600c45251..af7c10cac7dd9cd9e0bd5c0e0b433b76b52fcc38 100644 (file)
@@ -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 */
 \f