Commit b7f005ce authored by unknown's avatar unknown

BUG#10831 ndb mgmd LogDestination maxfiles does not rotate logs properly


ndb/src/common/util/File.cpp:
  my_stat returns NULL on failure, not non-zero.
  
  i.e. exactly the opposite of stat(2).
  
  providing confusion for unix programmers, who expect errors to be non-zero.
  
  Clean up File_class::exists(char*) to use the my_stat interface properly.
parent 431ef177
...@@ -28,29 +28,9 @@ ...@@ -28,29 +28,9 @@
bool bool
File_class::exists(const char* aFileName) File_class::exists(const char* aFileName)
{ {
bool rc = true; MY_STAT stmp;
#ifdef USE_MY_STAT_STRUCT
struct my_stat stmp;
#else
struct stat stmp;
#endif
if (my_stat(aFileName, &stmp, MYF(0)) != 0)
{
rc = false;
}
/* return (my_stat(aFileName, &stmp, MYF(0))!=NULL);
File f;
if (!f.open(aFileName, "r"))
{
rc = (errno == ENOENT ? false : true);
}
else
{
f.close();
}
*/
return rc;
} }
long long
......
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