[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)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Fri, 19 Aug 2022 01:08:54 +0000 (02:08 +0100)
commitb7db8f03cfddd2a9c42a3b58a9732fd102005c2b
treec0c26f76e9a5cfd6e6814997720ef07445307e94
parentfd6c641176fcdc67673a92efbe565cc603b01d7b
[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