[Mesa-dev] [Bug 98632] Fix build on Hurd without PATH_MAX

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Nov 19 03:20:00 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=98632

Kenneth Graunke <kenneth at whitecape.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Kenneth Graunke <kenneth at whitecape.org> ---
I liked Samuel's approach of allocating the name to be the correct length, but
opted to use asprintf rather than trying to manually compute that length.

Fixed by:

commit 9bfee7047b70cb0aa026ca9536465762f96cb2b1
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Nov 15 11:53:33 2016 -0800

    mesa: Drop PATH_MAX usage.

    GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
    limitation, so this failed to compile.  Apparently glibc does not
    enforce PATH_MAX restrictions anyway, so it's kind of a hoax:

    https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

    MSVC uses a different name (_MAX_PATH) as well, which is annoying.

    We don't really need it.  We can simply asprintf() the filenames.
    If the filename exceeds an OS path limit, presumably fopen() will
    fail, and we already check that.  (We actually use ralloc_asprintf
    because Mesa provides that everywhere, and it doesn't look like we've
    provided an implementation of GNU's asprintf() for all platforms.)

    Fixes the build on GNU/Hurd.

    Cc: "13.0" <mesa-stable at lists.freedesktop.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161119/732f0657/attachment-0001.html>


More information about the mesa-dev mailing list