]> git.proxmox.com Git - mirror_qemu.git/commit
util/path: Do not cache all filenames at startup
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 19 May 2019 20:19:41 +0000 (13:19 -0700)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 24 Jun 2019 20:19:30 +0000 (22:19 +0200)
commitf3a8bdc1d5b260d31422edd46360ff849dfbcc93
tree17037793383c863c36cb2b3a9174c142ad7cdd25
parent474f3938d79ab36b9231c9ad3b5a9314c2aeacde
util/path: Do not cache all filenames at startup

If one uses -L $PATH to point to a full chroot, the startup time
is significant.  In addition, the existing probing algorithm fails
to handle symlink loops.

Instead, probe individual paths on demand.  Cache both positive
and negative results within $PATH, so that any one filename is
probed only once.

Use glib filename functions for clarity.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190519201953.20161-2-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
util/path.c