List:Commits« Previous MessageNext Message »
From:gni Date:October 20 2006 8:57am
Subject:bk commit into 5.1 tree (gni:1.2315) BUG#21858
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of root. When root 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-10-20 14:55:14+08:00, gni@dev3-127.(none) +1 -0
  BUG #21858 Make sure retry when EINTR returns, which decreases memory leak chance.

  storage/ndb/src/common/util/File.cpp@stripped, 2006-10-20 14:55:12+08:00,
gni@dev3-127.(none) +14 -2
    Avoid memory leak when EINTR error returns. Even though a close error happens, a ERROR
message in out-file is given, and this shouldn't affect the normally running.

# 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:	gni
# Host:	dev3-127.(none)
# Root:	/mnt/mysql/home/ngb/mysql-5.1/mysql-5.1-bug21858

--- 1.13/storage/ndb/src/common/util/File.cpp	2006-10-20 14:56:19 +08:00
+++ 1.14/storage/ndb/src/common/util/File.cpp	2006-10-20 14:56:19 +08:00
@@ -123,12 +123,24 @@
 File_class::close()
 {
   bool rc = true;
+  int retval = 0;
+
   if (m_file != NULL)
   { 
     ::fflush(m_file);
-    rc = (::fclose(m_file) == 0 ? true : false);
-    m_file = NULL; // Try again?
+    retval = ::fclose(m_file);
+    while ( (retval != 0) && (errno == EINTR) ){
+      retval = ::fclose(m_file);
+    }
+    if( retval == 0){
+      rc = true;
+    }
+    else {
+      rc = false;
+      ndbout_c("ERROR: Close file error in File.cpp for %s",strerror(errno));
+    }   
   }  
+  m_file = NULL;
   
   return rc;
 }
Thread
bk commit into 5.1 tree (gni:1.2315) BUG#21858gni23 Oct