This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Make ldconfig more quiet again
On Mon, May 07, 2001 at 12:15:04PM -0700, H . J . Lu wrote:
> On Mon, May 07, 2001 at 09:07:40PM +0200, Andreas Jaeger wrote:
> >
> > Two questions:
> > - wouldn't it be better to cache the needed stat information in struct
> > dir_entry?
>
> I don't think speed is critical for ldconfig. On the other hand,
> it is not a bad idea.
Speed is very critical for ldconfig, think about installations.
Your patch has made ldconfig unnecessarily verbose under normal
situations (e.g. having a non-existant directory in ld.so.conf would only
print warning with -v, now it is unconditional, even worse if you have a
stale symlink (such as because of package installation/removal in progress
where e.g. libfoo.so is still present but the library it points to has been
removed already), you'll get a warning as well.
Here is a fix:
2001-05-17 Jakub Jelinek <jakub@redhat.com>
* elf/ldconfig.c (add_dir): Only warn about stat failure if
opt_verbose.
(search_dir): Likewise.
--- elf/ldconfig.c 2001/05/11 20:39:30 1.15
+++ elf/ldconfig.c 2001/05/17 15:28:11 1.16
@@ -336,7 +336,8 @@ add_dir (const char *line)
if (stat64 (entry->path, &stat_buf))
{
- error (0, errno, _("Can't stat %s"), entry->path);
+ if (opt_verbose)
+ error (0, errno, _("Can't stat %s"), entry->path);
free (entry->path);
free (entry);
return;
@@ -688,7 +689,8 @@ search_dir (const struct dir_entry *entr
a directory. */
if (stat64 (real_file_name, &stat_buf))
{
- error (0, errno, _("Can't stat %s"), file_name);
+ if (opt_verbose)
+ error (0, errno, _("Can't stat %s"), file_name);
continue;
}
is_dir = S_ISDIR (stat_buf.st_mode);
Jakub