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: olafBuddenhagen
Subject: Re: [PATCH 2/3] Add the code for starting up the mountee
Date: Sat, 18 Jul 2009 04:22:36 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

Hi,

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...

This is not really an important issue, though.

-antrik-




reply via email to

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