bug-hurd
[Top][All Lists]
Advanced

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

Re: error checking in libnetfs


From: James Morrison
Subject: Re: error checking in libnetfs
Date: Tue, 2 Apr 2002 06:59:04 -0800 (PST)

> >  Humm, again I followed the example in libdiskfs/io-restrict-auth.c
> >  .
> 
> This is the original:
> 
>   newpi = netfs_make_protid (user->po, new_user);
>   if (newpi)
>     {
>       *newport = ports_get_right (newpi);
>       mutex_unlock (&user->po->np->lock);
>       *newporttype = MACH_MSG_TYPE_MAKE_SEND;
>     }
>   else
>     {
>       mutex_unlock (&user->po->np->lock);
>       iohelp_free_iouser (new_user);
>       err = ENOMEM;
>     }
>   
> 
> You changed it to:
> 
>   err = netfs_make_protid (user->po, new_user, &newpi);
>   if (! err)
>     {
>       *newport = ports_get_right (newpi);
>       mutex_unlock (&user->po->np->lock);
>       *newporttype = MACH_MSG_TYPE_MAKE_SEND;
>     }
>   mutex_unlock (&user->po->np->lock);
>   iohelp_free_iouser (new_user);
> 
> i.e. you unconditionally free NEW_USER.
> 

 The original is correct.  However, in libdiskfs/io-restrict-auth.c USER, which
is equivalent to NEW_USER, is duplicated.  Should the libnetfs implementation
also duplicate NEW_USER so it can be free'd?

> 
> If you can change these things and resubmit a new patch, that would be
> great.
> 

 I'll make these changes and resubmit later on today.


=====
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/



reply via email to

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