BUG #21858 Make sure retry when EINTR returns, which decreases memory leak chance.

parent b52d86cf
...@@ -123,13 +123,25 @@ bool ...@@ -123,13 +123,25 @@ bool
File_class::close() File_class::close()
{ {
bool rc = true; bool rc = true;
int retval = 0;
if (m_file != NULL) if (m_file != NULL)
{ {
::fflush(m_file); ::fflush(m_file);
rc = (::fclose(m_file) == 0 ? true : false); retval = ::fclose(m_file);
m_file = NULL; // Try again? 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; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment