]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-library-cleanup-20060702
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 3 Jul 2006 02:16:35 +0000 (02:16 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 3 Jul 2006 02:16:35 +0000 (02:16 +0000)
afs_winsockCleanup

(cherry picked from commit 20b4f785b56ff604bab72d3b624aae74a9e5ae5d)

src/libafsauthent/afsauthent.def
src/rx/rx.c
src/rx/rx_pthread.c
src/shlibafsauthent/afsauthent.def
src/util/afsutil.h
src/util/winsock_nt.c

index a822985923ecc5e239da605c36e8ed3aa3a997f4..e90d63dab2b99c40b331fe908fd287f6e3bb4dda 100644 (file)
@@ -84,3 +84,5 @@ EXPORTS
 
        DISK_function_names                             @83 DATA
        VOTE_function_names                             @84 DATA
+       rx_Finalize                                     @85
+       pr_End                                          @86
index a03d38d897f2b4e9ad432fa046d8934ba0020285..27d9e97c8214e79b1ada1ce83f2a292b3b77705a 100644 (file)
@@ -2021,6 +2021,10 @@ rx_Finalize(void)
     }
     rxi_flushtrace();
 
+#ifdef AFS_NT40_ENV
+    afs_winsockCleanup();
+#endif
+
     rxinit_status = 1;
     UNLOCK_RX_INIT;
 }
index d67a691978f9a076c5cca7149ef56f198789ede1..4e622d806acb73058cf0e3482fd871716d3c5590 100644 (file)
@@ -87,7 +87,9 @@ rxi_Delay(int sec)
 void
 rxi_InitializeThreadSupport(void)
 {
-    listeners_started = 0;
+       /* listeners_started must only be reset if
+        * the listener thread terminates */
+       /* listeners_started = 0; */
     clock_GetTime(&rxi_clockNow);
 }
 
@@ -322,6 +324,9 @@ rxi_StartListener(void)
     pthread_attr_t tattr;
     AFS_SIGSET_DECL;
 
+       if (listeners_started)
+               return;
+
     if (pthread_attr_init(&tattr) != 0) {
        dpf
            (("Unable to create Rx event handling thread (pthread_attr_init)\n"));
index 20fd1192d462629118aaa9575ab9bced628bb43a..a7199c5019d6d38c2bf4aeb71bee174a39ee9c15 100644 (file)
@@ -84,3 +84,5 @@ EXPORTS
 
        DISK_function_names                             @83 DATA
        VOTE_function_names                             @84 DATA
+       rx_Finalize                                     @85
+       pr_End                                          @86
index d70c6a2d1555d975a7b402eb308175a335d79dfc..60d0cf141dd283b884e499a5a8035ca31056c9a0 100644 (file)
@@ -90,6 +90,7 @@ afs_vsnprintf( /*@out@ */ char *p, size_t avail, const char *fmt,
 
 /* Initialize the windows sockets before calling networking routines. */
      extern int afs_winsockInit(void);
+     extern void afs_winsockCleanup(void);
 
      struct timezone {
         int tz_minuteswest;    /* of Greenwich */
index 5f95efaea8c8875a53b7683f91e6098a90115d6a..e2e308b7678a49569bf8e9594622df80052faac0 100644 (file)
@@ -25,11 +25,11 @@ RCSID
  * 
  * Returns 0 on success, -1 on error.
  */
+static int once = 1;
+
 int
 afs_winsockInit(void)
 {
-    static int once = 1;
-
     if (once) {
        int code;
        WSADATA data;
@@ -48,6 +48,13 @@ afs_winsockInit(void)
     return 0;
 }
 
+void
+afs_winsockCleanup(void)
+{
+    WSACleanup();
+    once = 0;
+}
+
 int
 afs_gettimeofday(struct timeval *tv, struct timezone *tz)
 {