This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Handle symlink to directory in ldconfig.


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]