user: speed up init_paths a bit
authorMike Frysinger <vapier@gentoo.org>
Mon, 7 Feb 2011 06:05:56 +0000 (01:05 -0500)
committerRiku Voipio <riku.voipio@nokia.com>
Wed, 9 Feb 2011 08:33:54 +0000 (10:33 +0200)
commit8a10e51a10745b5d173e445bae623943f7fee97c
tree1d3951bddc0537529738b04f780c7c2be2631eec
parentc620f251e8e2fc53f7557b46573673f91c5ee666
user: speed up init_paths a bit

The current init_paths code will attempt to opendir() every single file it
finds.  This can obviously generated a huge number of syscalls with even a
moderately small sysroot that will fail.  Since the readdir() call provides
the file type in the struct itself, use it.  On my system, this prevents
over 1000 syscalls from being made at every invocation of a target binary,
and I only have a C library installed.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
path.c