summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2006-11-03 16:24:53 +0000
committerJuanma Barranquero <lekktu@gmail.com>2006-11-03 16:24:53 +0000
commit5796dab79d3da052f4916a2c37d20c32775184f0 (patch)
treec7d25bea67f1f7b536e43603346771fed5c732b9 /lib-src/emacsclient.c
parentb6ce9c466c56b8486418730875d57b1e165a7581 (diff)
(initialize_sockets): Don't initialize Winsock more than once.
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r--lib-src/emacsclient.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index bede01aaa0..af7c10cac7 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 */