[master] f04d7df6e vtest: put cwd on the stack

Dridi Boukelmoune dridi at varni.sh
Thu Oct 15 10:29:09 UTC 2020


On Thu, Oct 15, 2020 at 10:06 AM Nils Goroll <nils.goroll at uplex.de> wrote:
>
>
> commit f04d7df6e6d5b350740e01d24749a3930390b7a0
> Author: Nils Goroll <nils.goroll at uplex.de>
> Date:   Thu Oct 15 12:01:35 2020 +0200
>
>     vtest: put cwd on the stack
>
>     0051cbe3b9cc24586e0ad99cff72041c6df944b8 did not work on
>     solaris-descendents, the man page clearly states that the size argument
>     also determines the buffer to be malloc()ed for a NULL buffer argument.

I think this the way to go [1], POSIX says this about the size argument:

> The size argument is the size in bytes of the character array pointed to
> by the buf argument. If buf is a null pointer, the behavior of getcwd() is
> unspecified.

0051cbe3b9cc was triggered by a GCC very eager to enforce *a* behavior
on Linux:

https://github.com/vtest/VTest/pull/22

Cheers

[1] unless someone wants to fix GCC instead :-p


More information about the varnish-commit mailing list