[PATCH] Avoid a stack buffer when not needed
authorPino Toscano <toscano.pino@tiscali.it>
Thu, 10 Feb 2022 07:26:11 +0000 (08:26 +0100)
committerPino Toscano <pino@debian.org>
Sat, 3 Sep 2022 06:15:09 +0000 (07:15 +0100)
commit4850d15b8f3d9b78f16e70dcca0326fac6097db1
tree60999a270c94106efcc8e8ea52779dac724b1935
parent11e0f83ec91ff5b9afe057f9755b19b46065d807
[PATCH] Avoid a stack buffer when not needed

Allocate a PATH_MAX-sized buffer on stack only in case we are not using
realpath(X, null), i.e. on platforms with older POSIX versions, macOS,
or Android.

This fixes the build on platforms that do not have PATH_MAX (e.g.
GNU/Hurd), and it provides a minor optimization on realpath(X, null)
platforms.

Change-Id: Icd92a1b15ec18c5eef8113408e9610dfac774101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Gbp-Pq: Name upstream_Avoid-a-stack-buffer-when-not-needed.patch
src/corelib/io/qfilesystemengine_unix.cpp