bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: module 'fts-lgpl' not complete


From: Bruno Haible
Subject: Re: module 'fts-lgpl' not complete
Date: Wed, 25 Jan 2006 19:13:08 +0100
User-agent: KMail/1.5

Hi Jim,

> Regarding the second patch, I see no explanation for why it
> makes such a fundamental change (not appending `.'?).

Actually the end of that function was a bit incomplete. It should probably
look like this:

    /* FILE refers to a symbolic link and the name ends with a slash.
       Call stat() to get info about the link's destination.  */
  
    lstat_result = stat (file, sbuf);
    if (lstat_result >= 0 && !S_ISDIR (sbuf->st_mode))
      {
        errno = EINVAL;
        return -1;
      }
    else
      return lstat_result;

The idea is that if FILE is a symlink and ends in '/', we want to inspect
the inode of the target directory of the link, i.e. follow the symlink
chain. lstat(concat(FILE,".")) does this, but stat(FILE) does this as well,
and needs no intermediate memory allocation. Or am I overlooking something
obvious?

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]