Re: [Bug libc/11459] New: ftw doesn't work like documented (may be a documentation bug)

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

 



On Mon, May 24, 2010 at 07:41:49PM +0200, Michael Kerrisk wrote:
> Hello Pierre,
> 
> On Tue, Apr 6, 2010 at 11:03 AM, Pierre Habouzit <madcoder@xxxxxxxxxx> wrote:
> > See below a bug reported against the glibc.  Since the glibc maintainer
> > dodged that one, I assume the bug indeed is in the documentation of
> > ftw(3). My manpages are the 3.24-1 Debian package.
> 
> Yes. The man page is clearly incorrect. Thanks for reporting this.
> 
> > IMHO the patch is:
> >
> >  -fpath is the pathname of the entry relative to dirpath.
> >  +fpath is the pathname of the entry relative to the current working directory.
> >
> > POSIX is very vague about what "fpath" should be btw.
> 
> (Agreed. It could be more precise.)
> 
> I believe the correct text should be this:
> 
>        fpath   is  the  pathname  of  the  entry,  and  is
>        expressed either as  a  pathname  relative  to  the
>        calling  process's current working directory at the
>        time of the call to ftw(), if dirpath was expressed
>        as a relative pathname, or as an absolute pathname,
>        if dirpath was expressed as an  absolute  pathname.
> 
> I have updated the man page accordingly, but would welcome
> review/checking of this text.

Afaict, it's not correct: ftw may perform chdir() calls, so the pathname
is relative to the current working directory at the time `fn` is called.

I'd rather phrase it that way (minus probable english mistakes):

    fpath is the pathname of the entry, and is either a relative
    pathname to the current working directory of the application when
    `fn` is called, or as an absolute pathname.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux