diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-07 16:23:36 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-09 13:25:17 +0200 |
commit | c90821aa49e918473c873b93108c8e6755074b27 (patch) | |
tree | 59de8f8a1550a91bb8f78585cd6ef1b941a1e813 /src | |
parent | shared/bus-util: simplification (diff) | |
download | systemd-c90821aa49e918473c873b93108c8e6755074b27.tar.xz systemd-c90821aa49e918473c873b93108c8e6755074b27.zip |
shared/bus-util: rename variables to follow newer style
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/bus-util.c | 22 | ||||
-rw-r--r-- | src/shared/bus-util.h | 4 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index ea506f2725..e12f95d4b1 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -197,14 +197,14 @@ int bus_check_peercred(sd_bus *c) { return 1; } -int bus_connect_system_systemd(sd_bus **_bus) { +int bus_connect_system_systemd(sd_bus **ret_bus) { _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL; int r; - assert(_bus); + assert(ret_bus); if (geteuid() != 0) - return sd_bus_default_system(_bus); + return sd_bus_default_system(ret_bus); /* If we are root then let's talk directly to the system * instance, instead of going via the bus */ @@ -219,28 +219,27 @@ int bus_connect_system_systemd(sd_bus **_bus) { r = sd_bus_start(bus); if (r < 0) - return sd_bus_default_system(_bus); + return sd_bus_default_system(ret_bus); r = bus_check_peercred(bus); if (r < 0) return r; - *_bus = TAKE_PTR(bus); - + *ret_bus = TAKE_PTR(bus); return 0; } -int bus_connect_user_systemd(sd_bus **_bus) { +int bus_connect_user_systemd(sd_bus **ret_bus) { _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL; _cleanup_free_ char *ee = NULL; const char *e; int r; - assert(_bus); + assert(ret_bus); e = secure_getenv("XDG_RUNTIME_DIR"); if (!e) - return sd_bus_default_user(_bus); + return sd_bus_default_user(ret_bus); ee = bus_address_escape(e); if (!ee) @@ -256,14 +255,13 @@ int bus_connect_user_systemd(sd_bus **_bus) { r = sd_bus_start(bus); if (r < 0) - return sd_bus_default_user(_bus); + return sd_bus_default_user(ret_bus); r = bus_check_peercred(bus); if (r < 0) return r; - *_bus = TAKE_PTR(bus); - + *ret_bus = TAKE_PTR(bus); return 0; } diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h index 00514e359f..955cdcb57c 100644 --- a/src/shared/bus-util.h +++ b/src/shared/bus-util.h @@ -33,8 +33,8 @@ bool bus_error_is_unknown_service(const sd_bus_error *error); int bus_check_peercred(sd_bus *c); -int bus_connect_system_systemd(sd_bus **_bus); -int bus_connect_user_systemd(sd_bus **_bus); +int bus_connect_system_systemd(sd_bus **ret_bus); +int bus_connect_user_systemd(sd_bus **ret_bus); int bus_connect_transport(BusTransport transport, const char *host, bool user, sd_bus **bus); int bus_connect_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus); |