diff options
author | unknown <stewart@mysql.com> | 2005-05-25 15:35:51 +1000 |
---|---|---|
committer | unknown <stewart@mysql.com> | 2005-05-25 15:35:51 +1000 |
commit | 605f7061dc2ca28d78ad652b9b5a7225f55ccb9a (patch) | |
tree | f5cb76a56ebeec8786fc4a3d052d9216b90704aa /ndb/src | |
parent | 5b77d9b8f3ff262fffca273781e74a9a10f345bf (diff) | |
download | mariadb-git-605f7061dc2ca28d78ad652b9b5a7225f55ccb9a.tar.gz |
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.
Diffstat (limited to 'ndb/src')
-rw-r--r-- | ndb/src/common/util/File.cpp | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 937b8c0fa59..e514ad8e122 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -28,29 +28,9 @@ bool File_class::exists(const char* aFileName) { - bool rc = true; -#ifdef USE_MY_STAT_STRUCT - struct my_stat stmp; -#else - struct stat stmp; -#endif - if (my_stat(aFileName, &stmp, MYF(0)) != 0) - { - rc = false; - } - - /* - File f; - if (!f.open(aFileName, "r")) - { - rc = (errno == ENOENT ? false : true); - } - else - { - f.close(); - } - */ - return rc; + MY_STAT stmp; + + return (my_stat(aFileName, &stmp, MYF(0))!=NULL); } long |