Skip to content
  • Jon Olav Hauglid's avatar
    711d4581
    Bug#25103242: 5.6 DOES NOT BUILD ON FEDORA 25 DUE TO READDIR_R BEING DEPRECATED · 711d4581
    Jon Olav Hauglid authored
    Backport from trunk to 5.6 of:
    
    Bug#23708395: GLIBC 2.24 DEPRECATES READDIR_R() BREAKING
                  DEBUG BUILD OF MYSQL SERVER
    
    As of glibc 2.24, readdir_r() has been deprecated. This breaks
    our debug builds since the deprecation warning is upgraded to
    an error during compilation.
    
    This patch fixes the problem by removing use of readdir_r() and
    using readdir() instead. This is thread safe as long as readdir()
    is only used concurrently on different DIR* - which it is in
    our case.
    
    POSIX quote: "The pointer returned by readdir() points to data
    which may be overwritten by another call to readdir() on the same
    directory stream. This data is not overwritten by another call
    to readdir() on a different directory stream."
    
    Change-Id: I85a6f5da2d48c8d5a9804cd6281411d9e757f46c
    (cherry picked from commit ba5245e9fef2257d60213076598268f544ca7109)
    (cherry picked from commit 865c124d1bdfd4eeee5eb42ea9faa9c8b45bfbb0)
    (cherry picked from commit d083887ca7cf90ac370b1a564b5090358f9a097f)
    711d4581
    Bug#25103242: 5.6 DOES NOT BUILD ON FEDORA 25 DUE TO READDIR_R BEING DEPRECATED
    Jon Olav Hauglid authored
    Backport from trunk to 5.6 of:
    
    Bug#23708395: GLIBC 2.24 DEPRECATES READDIR_R() BREAKING
                  DEBUG BUILD OF MYSQL SERVER
    
    As of glibc 2.24, readdir_r() has been deprecated. This breaks
    our debug builds since the deprecation warning is upgraded to
    an error during compilation.
    
    This patch fixes the problem by removing use of readdir_r() and
    using readdir() instead. This is thread safe as long as readdir()
    is only used concurrently on different DIR* - which it is in
    our case.
    
    POSIX quote: "The pointer returned by readdir() points to data
    which may be overwritten by another call to readdir() on the same
    directory stream. This data is not overwritten by another call
    to readdir() on a different directory stream."
    
    Change-Id: I85a6f5da2d48c8d5a9804cd6281411d9e757f46c
    (cherry picked from commit ba5245e9fef2257d60213076598268f544ca7109)
    (cherry picked from commit 865c124d1bdfd4eeee5eb42ea9faa9c8b45bfbb0)
    (cherry picked from commit d083887ca7cf90ac370b1a564b5090358f9a097f)
Loading