~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/os/os0file.c

Merge Revision revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6724 from MySQL InnoDB

Original revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6724

Original Authors: marko
Original commit message:
branches/zip: Merge revisions 6613:6669 from branches/5.1:
  ------------------------------------------------------------------------
  r6669 | jyang | 2010-02-11 12:24:19 +0200 (Thu, 11 Feb 2010) | 7 lines

  branches/5.1: Fix bug #50691, AIX implementation of readdir_r
  causes InnoDB errors. readdir_r() returns an non-NULL value
  in the case of reaching the end of a directory. It should
  not be treated as an error return.

  rb://238 approved by Marko
  ------------------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
791
791
#ifdef HAVE_READDIR_R
792
792
        ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent);
793
793
 
794
 
        if (ret != 0) {
 
794
        if (ret != 0
 
795
#ifdef UNIV_AIX
 
796
            /* On AIX, only if we got non-NULL 'ent' (result) value and
 
797
            a non-zero 'ret' (return) value, it indicates a failed
 
798
            readdir_r() call. An NULL 'ent' with an non-zero 'ret'
 
799
            would indicate the "end of the directory" is reached. */
 
800
            && ent != NULL
 
801
#endif
 
802
           ) {
795
803
                fprintf(stderr,
796
804
                        "InnoDB: cannot read directory %s, error %lu\n",
797
805
                        dirname, (ulong)ret);