From: Date: May 25 2005 7:36am Subject: bk commit into 4.1 tree (stewart:1.2294) BUG#10831 List-Archive: http://lists.mysql.com/internals/25246 X-Bug: 10831 Message-Id: <20050525053601.B9BDF1C001DC@kennedy.flamingspork.com> Below is the list of changes that have just been committed into a local 4.1 repository of stewart. When stewart 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 1.2294 05/05/25 15:35:51 stewart@stripped +1 -0 BUG#10831 ndb mgmd LogDestination maxfiles does not rotate logs properly ndb/src/common/util/File.cpp 1.9 05/05/25 15:35:44 stewart@stripped +3 -23 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. # 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: stewart # Host: kennedy.(none) # Root: /home/stewart/Documents/MySQL/4.1/main --- 1.8/ndb/src/common/util/File.cpp 2004-11-12 07:38:40 +11:00 +++ 1.9/ndb/src/common/util/File.cpp 2005-05-25 15:35:44 +10:00 @@ -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