bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 2/3] Add the code for starting up the mountee


From: Sergiu Ivanov
Subject: Re: [PATCH 2/3] Add the code for starting up the mountee
Date: Mon, 3 Aug 2009 12:02:21 +0300
User-agent: Mutt/1.5.18 (2008-05-17)

Hello,

On Sat, Jul 18, 2009 at 04:22:36AM +0200, olafBuddenhagen@gmx.net wrote:
> On Thu, Jul 16, 2009 at 10:41:34PM +0300, Sergiu Ivanov wrote:
> > On Fri, Jul 10, 2009 at 04:17:23AM +0200, olafBuddenhagen@gmx.net
> > wrote:
> > > On Sun, Jul 05, 2009 at 07:10:48PM +0300, Sergiu Ivanov wrote:
> 
> > > > I met this style (using intermediate variables) quite often in
> > > > unionfs and my understanding is that keeping to such style you
> > > > don't clobber the parameters.  That is, should fsys_getroot fail,
> > > > port will remain unchanged.
> > > 
> > > You are right. However, if it is really important that "port"
> > > doesn't get clobbered when an error occurs, this should be
> > > explicitely documented in the function comment. If callers don't
> > > rely on this behaviour OTOH, I wouldn't bother.
> > 
> > I added the corresponding bit to the comment.  IMHO, it is a good
> > thing when the function does not clobber its out parameters on errors.
> 
> I wouldn't subscribe to it being a good thing in general. I don't see
> how it could avoid programming errors, or otherwise make code more
> readable, to always do this. It is useful only in specific cases.
> 
> In this particular case it does indeed seem totally useless: it's not
> like the caller might have some other value in there that it would like
> to keep using when this call fails...

I see.  Thank you for the explanation, I'll keep this in mind.
 
> This is not really an important issue, though.

In this case, I think I'll leave it as it is now, both for (probably
meaningless) consistency and for saving the time for more important
issues.

Regards,
scolobb




reply via email to

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