List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:September 8 2006 3:39pm
Subject:bk commit into 5.0 tree (cmiller:1.2249)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-08 11:39:03-04:00, cmiller@stripped +1 -0
  Fix initialized memory.  Count the number of failures in shm-closing 
  functions and return it.

  vio/viosocket.c@stripped, 2006-09-08 11:39:02-04:00, cmiller@stripped +27 -2
    Initialize the return code and set it according to errors in the closing 
    functions.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cmiller
# Host:	zippy.cornsilk.net
# Root:	/home/cmiller/work/mysql/mysql-5.0--windows-vio-uninit

--- 1.37/vio/viosocket.c	2006-09-08 11:39:07 -04:00
+++ 1.38/vio/viosocket.c	2006-09-08 11:39:07 -04:00
@@ -545,9 +545,13 @@
 }
 
 
+/**
+ Close shared memory and DBUG_PRINT any errors that happen on closing.
+ @return Zero if all closing functions succeed, and nonzero otherwise.
+*/
 int vio_close_shared_memory(Vio * vio)
 {
-  int r;
+  int error_count= 0;
   DBUG_ENTER("vio_close_shared_memory");
   if (vio->type != VIO_CLOSED)
   {
@@ -561,23 +565,44 @@
       result if they are success.
     */
     if (UnmapViewOfFile(vio->handle_map) == 0) 
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("UnmapViewOfFile() failed"));
+    }
     if (CloseHandle(vio->event_server_wrote) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->esw) failed"));
+    }
     if (CloseHandle(vio->event_server_read) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->esr) failed"));
+    }
     if (CloseHandle(vio->event_client_wrote) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->ecw) failed"));
+    }
     if (CloseHandle(vio->event_client_read) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->ecr) failed"));
+    }
     if (CloseHandle(vio->handle_file_map) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->hfm) failed"));
+    }
     if (CloseHandle(vio->event_conn_closed) == 0)
+    {
+      error_count++;
       DBUG_PRINT("vio_error", ("CloseHandle(vio->ecc) failed"));
+    }
   }
   vio->type= VIO_CLOSED;
   vio->sd=   -1;
-  DBUG_RETURN(!r);
+  DBUG_RETURN(error_count);
 }
 #endif /* HAVE_SMEM */
 #endif /* __WIN__ */
Thread
bk commit into 5.0 tree (cmiller:1.2249)Chad MILLER8 Sep