[Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

Emil Velikov emil.l.velikov at gmail.com
Tue Nov 15 20:56:32 UTC 2016


On 15 November 2016 at 20:04, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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>
> Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
> ---
>  src/mesa/main/arbprogram.c | 12 ++++--------
>  src/mesa/main/shaderapi.c  | 37 +++++++++++--------------------------
>  2 files changed, 15 insertions(+), 34 deletions(-)
>
> Samuel, does this fix the build for you?
>
> Emil, I didn't add the Fixes: tag because this was broken long before
> that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
> for a while now.
>
Ack, makes sense. I've only looked at the latest instance which
introduces/uses the define.

The patch is spot on afaict
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

Emil


More information about the mesa-dev mailing list