This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Handle symlink to directory in ldconfig.
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: PATCH: Handle symlink to directory in ldconfig.
- From: Andreas Jaeger <aj at suse dot de>
- Date: 07 May 2001 20:34:37 +0200
- Cc: GNU C Library <libc-alpha at sourceware dot cygnus dot com>
- References: <20010507112025.A13019@lucon.org>
"H . J . Lu" <hjl@lucon.org> writes:
> This patch for ldconfig handls symlink to directory.
>
>
> H.J.
> ---
> 2001-05-07 H.J. Lu <hjl@gnu.org>
>
> * elf/ldconfig.c (add_single_dir): Call stat to check if 2
> directory paths point to the same inode or not.
> (search_dir): Handle symlink to directory.
>
> --- libc/elf/ldconfig.c.link Mon Mar 19 10:36:17 2001
> +++ libc/elf/ldconfig.c Mon May 7 11:10:15 2001
> @@ -264,13 +264,24 @@ static void
> add_single_dir (struct dir_entry *entry, int verbose)
> {
> struct dir_entry *ptr, *prev;
> + struct stat64 stat_buf1, stat_buf2;
>
> ptr = dir_entries;
> prev = ptr;
> while (ptr != NULL)
> {
> /* Check for duplicates. */
> - if (strcmp (ptr->path, entry->path) == 0)
> + if (stat64 (ptr->path, &stat_buf1))
> + {
> + error (0, errno, _("Fatal error: can't stat %s"), ptr->path);
> + exit (1);
Please use error (EXIT_FAILURE,...) instead of the exit (1).
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj