From: Date: October 8 2006 5:26am Subject: bk commit into 4.1 tree (gni:1.2535) BUG#21858 List-Archive: http://lists.mysql.com/commits/13310 X-Bug: 21858 Message-Id: <200610080326.k983Qv9d029349@dev3-127> Below is the list of changes that have just been committed into a local 4.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-08 11:24:53+08:00, gni@dev3-127.(none) +1 -0 BUG #21858 Make sure retry when EINTR returns, which decreases memory leak chance. ndb/src/common/util/File.cpp@stripped, 2006-10-08 11:24:50+08:00, gni@dev3-127.(none) +15 -3 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-4.1/mysql-4.1-bug21858 --- 1.10/ndb/src/common/util/File.cpp 2006-10-08 11:25:59 +08:00 +++ 1.11/ndb/src/common/util/File.cpp 2006-10-08 11:25:59 +08:00 @@ -123,13 +123,25 @@ 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; }