]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-library-cleanup-20060702
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 3 Jul 2006 02:06:44 +0000 (02:06 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 3 Jul 2006 02:06:44 +0000 (02:06 +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 15ae52f6028bb8566833e777b16cf3d72381dbd5..687621ecccb791cd890a7ae3e027e4c37e3d4891 100644 (file)
@@ -110,6 +110,8 @@ EXPORTS
         PR_ListSuperGroups                             @108
        ka_AuthSpecificServersConn                      @109
        ka_KeyCheckSum                                  @110
+       rx_Finalize                                     @111
+       rx_InitHost                                     @112
 
 
 
index 893d73bd3f269a6e2caac079c4ea9b6241b30c5c..ff973735fe653be0122dd12e5aac9aedff3c3fd3 100644 (file)
@@ -2025,6 +2025,10 @@ rx_Finalize(void)
     }
     rxi_flushtrace();
 
+#ifdef AFS_NT40_ENV
+    afs_winsockCleanup();
+#endif
+
     rxinit_status = 1;
     UNLOCK_RX_INIT;
 }
index c663608f8cea6095d4d449d56848bb32d22d883d..a03a5a0bcf8f129ab09e952563e7dadd843406e6 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 e697403eacacf00a40444de36aac56f739ff9dad..3d074152abc6946d5b0341d00e26f9426975cfe6 100644 (file)
@@ -97,6 +97,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 1c52330d7d637bb8f3cf9b4f34eefcf48000391f..7d320511debe5595d92bc5d57c44a5bab601942a 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;
+}
+
 /* This function will begin to fail in the year 2038 */
 int
 afs_gettimeofday(struct timeval *tv, struct timezone *tz)