[systemd-devel] [PATCH 1/2] domain: move compose logic on its own kdbus_domain_compose_path() function
Daniel Mack
daniel at zonque.org
Thu Mar 20 03:01:35 PDT 2014
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.
Or are you planning to call it from somewhere else as well?
Thanks,
Daniel
More information about the systemd-devel
mailing list