On Friday 21 June 2013 13:43:28 Rich Felker wrote:
> On Fri, Jun 21, 2013 at 07:36:53PM +0200, Thomas De Schampheleire wrote:
> > > Thanks for the feedback, I just sent a third version.
> > > 
> > > For my info: is the check on the symbolic link only present to skip
> > > '.' and '..', or are there situations where /proc/<pid>/fd contains
> > > other entries than symbolic links and the two default directory
> > > entries?
> > 
> > If it is only to skip . and .., and if we make an additional
> > assumption that there will not be hidden files in /proc/<pid>/fd, then
> 
> > the entire code can be reduced to:
> I think it's a reasonable assumption that /proc/<pid>/fd does not
> contain anything but symbolic links, ., and .., but even if something
> else does exist, readlink will fail with EINVAL. That seems like a
> more reasonable way to detect the unexpected case of something other
> than symlinks being there.

that is a good idea indeed, thanks
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to