[systemd-devel] After=foo.busname oderings although kdbus is disabled

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Mar 14 08:12:02 PDT 2015


On Sat, Mar 14, 2015 at 03:56:10PM +0100, Michael Biebl wrote:
> The compiler might warn about the unused const char *n; So this might
> be slightly better:
> 
> 
> 
> diff --git a/src/core/service.c b/src/core/service.c
> index db1f1e7..d938550 100644
> --- a/src/core/service.c
> +++ b/src/core/service.c
> @@ -555,14 +555,16 @@ static int service_add_extras(Service *s) {
>                  s->notify_access = NOTIFY_MAIN;
> 
>          if (s->bus_name) {
> +#ifdef ENABLE_KDBUS
>                  const char *n;
> 
> -                r = unit_watch_bus_name(UNIT(s), s->bus_name);
> +                n = strjoina(s->bus_name, ".busname");
> +                r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER,
> n, NULL, true);
>                  if (r < 0)
>                          return r;
> +#endif
> 
> -                n = strjoina(s->bus_name, ".busname");
> -                r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER,
> n, NULL, true);
> +                r = unit_watch_bus_name(UNIT(s), s->bus_name);
>                  if (r < 0)
>                          return r;
>          }
Yep, looks good. Please push :)

Zbyszek


More information about the systemd-devel mailing list