On Fri, 2011-08-26 at 21:36:31 +0200, Raphael Hertzog wrote:
> On Fri, 26 Aug 2011, Guillem Jover wrote:
> > +static bool
> > +alternative_path_needs_update(const char *linkname, const char *filename)

> IMO you could just as well drop it entirely since you call
> xreadlink(linkname, false) (i.e. it can't error out, but it will return
> NULL in case of failure).

Actually I wanted the common semantics for an x* function. I've now
refactored xreadlink to not take a boolean argument. And found out
another instance where the code was expecting xreadlink never to
return on failure. Included on my next push.

> > +   linktarget = xreadlink(linkname, false);
> 
> There's a real possibility that linktarget is NULL when linkname doesn't
> exist. That's one of the usual case where can_replace_path() will return
> true and where path_needs_update() will thus be called.

Right, the patch was bogus regarding missing files, “make check” found
about it too though.

> That's the only problem I could spot.

I reimplemented it in a cleaner way.

thanks,
guillem



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to