]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-winsock-init-20060829
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 30 Aug 2006 02:41:41 +0000 (02:41 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 30 Aug 2006 02:41:41 +0000 (02:41 +0000)
WSAStartup and WSACleanup do not need to be wrapped by the app
to protect against multiple calls.

(cherry picked from commit a9bbe0e0dce33fd42cc944db3a657c95af6f6796)

src/util/winsock_nt.c

index e2e308b7678a49569bf8e9594622df80052faac0..075a687430a3a835fff12718bcc0038c1bddea19 100644 (file)
@@ -25,18 +25,13 @@ RCSID
  * 
  * Returns 0 on success, -1 on error.
  */
-static int once = 1;
-
 int
 afs_winsockInit(void)
 {
-    if (once) {
        int code;
        WSADATA data;
        WORD sockVersion;
 
-       once = 0;
-
        sockVersion = 2;
        code = WSAStartup(sockVersion, &data);
        if (code)
@@ -44,7 +39,6 @@ afs_winsockInit(void)
 
        if (data.wVersion != 2)
            return -1;
-    }
     return 0;
 }
 
@@ -52,7 +46,6 @@ void
 afs_winsockCleanup(void)
 {
     WSACleanup();
-    once = 0;
 }
 
 int