[systemd-devel] [PATCH 1/2] domain: move compose logic on its own kdbus_domain_compose_path() function

Djalal Harouni tixxdz at opendz.org
Fri Mar 21 04:32:52 PDT 2014


On Thu, Mar 20, 2014 at 11:01:35AM +0100, Daniel Mack wrote:
> Hi,
> 
> On 03/19/2014 09:24 PM, Djalal Harouni wrote:
> > Signed-off-by: Djalal Harouni <tixxdz at opendz.org>
> > ---
> >  domain.c | 68 +++++++++++++++++++++++++++++++++++-----------------------------
> >  1 file changed, 37 insertions(+), 31 deletions(-)
> > 
> > diff --git a/domain.c b/domain.c
> > index 2e05e90..d27cad2 100644
> > --- a/domain.c
> > +++ b/domain.c
> > @@ -223,12 +223,44 @@ struct kdbus_domain *kdbus_domain_find_by_major(unsigned int major)
> >  	return domain;
> >  }
> >  
> > +/* Caller has validated parent and name arguments */
> > +static int kdbus_domain_compose_path(struct kdbus_domain *domain,
> > +				     struct kdbus_domain *parent,
> > +				     const char *name)
> 
> [...]
> 
> > +	ret = kdbus_domain_compose_path(d, parent, name);
> > +	if (ret < 0)
> > +		goto exit_unlock;
> 
> Hmm, what's the purpose of adding such a single-user function? We
> generally try to avoid them, unless it really makes the code more
> readable, which isn't the case here IMHO.
Ok, I was planing to put that mutex inside it... Please ignore this one.

-- 
Djalal Harouni
http://opendz.org


More information about the systemd-devel mailing list