SHA256
1
0
forked from pool/glibc
glibc/glibc-ldconfigr-aux.diff

38 lines
1.0 KiB
Diff

2010-05-31 Petr Baudis <pasky@suse.cz>
* elf/ldconfig.c: Allow aux_cache_file open()ing to fail silently
even in the chroot mode.
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 6e71b09..6ba8e07 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
if (opt_chroot)
- {
- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
- if (aux_cache_file == NULL)
- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
- _PATH_LDCONFIG_AUX_CACHE);
- }
+ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
- if (! opt_ignore_aux_cache)
+ if (! opt_ignore_aux_cache && aux_cache_file)
load_aux_cache (aux_cache_file);
else
init_aux_cache ();
@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
if (opt_build_cache)
{
save_cache (cache_file);
- save_aux_cache (aux_cache_file);
+ if (aux_cache_file)
+ save_aux_cache (aux_cache_file);
}
return 0;