[systemd-devel] [PATCH] sd-bus: the bus returned should be the first arg

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Feb 18 17:54:39 PST 2014


On Tue, Feb 18, 2014 at 07:11:08PM +0100, Jason A. Donenfeld wrote:
> This matches the API of previous headers, such as sd-journal.h.
> ---
>  TODO                             | 2 --
>  src/libsystemd/sd-bus/bus-util.c | 8 ++++----
>  src/libsystemd/sd-bus/sd-bus.c   | 4 ++--
>  src/machine/machinectl.c         | 2 +-
>  src/systemd/sd-bus.h             | 4 ++--
>  5 files changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/TODO b/TODO
> index e74aa7e..63f3f7e 100644
> --- a/TODO
> +++ b/TODO
> @@ -29,8 +29,6 @@ Preparation for 209:
>  
>  * Review new libraries
>  
> -* libsystemd-journal returns the object created as first param in sd_journal_new(), sd_bus_new() and suchlike as last...
> -
>  Features:
>  
>  * implement Distribute= in socket units to allow running multiple
> diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
> index a468bca..8a6a70c 100644
> --- a/src/libsystemd/sd-bus/bus-util.c
> +++ b/src/libsystemd/sd-bus/bus-util.c
> @@ -1054,11 +1054,11 @@ int bus_open_transport(BusTransport transport, const char *host, bool user, sd_b
>                  break;
>  
>          case BUS_TRANSPORT_REMOTE:
> -                r = sd_bus_open_system_remote(host, bus);
> +                r = sd_bus_open_system_remote(bus, host);
>                  break;
>  
Hi,
I think Lennart meant a change the other way around, since the new policy is
to have the return value as the last argument. But sd_j_* functions are older
and do not respect this rule. But changing them would require a break of the
API, which, to me, is not worth it.

Zbyszek


More information about the systemd-devel mailing list