From e2c13faa266a4d2adededc8b720b498f914d530e Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Mon, 17 Apr 2017 11:02:13 +0200 Subject: Update to newer sd-bus API --- rcm-server-main.c | 2 +- utils.h | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/rcm-server-main.c b/rcm-server-main.c index 5177c3c..9adccbc 100644 --- a/rcm-server-main.c +++ b/rcm-server-main.c @@ -1233,7 +1233,7 @@ main(int argc, char **argv) { int r; struct manager *mgr; - _cleanup_bus_close_unref_ sd_bus *bus = NULL; + _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL; _cleanup_bus_slot_unref_ struct sd_bus_slot *vtable_slot = NULL; _cleanup_bus_slot_unref_ struct sd_bus_slot *enumerator_slot = NULL; _cleanup_bus_slot_unref_ struct sd_bus_slot *objm_slot = NULL; diff --git a/utils.h b/utils.h index f02c47a..49ff0b4 100644 --- a/utils.h +++ b/utils.h @@ -93,16 +93,6 @@ static inline void* zmalloc(size_t size) } \ struct __useless_struct_to_allow_trailing_semicolon__ - -static inline void sd_bus_close_unrefp(sd_bus **bus) { - if (*bus) { - sd_bus_flush(*bus); - sd_bus_close(*bus); - sd_bus_unref(*bus); - } -} -#define _cleanup_bus_close_unref_ _cleanup_(sd_bus_close_unrefp) - static inline unsigned strv_length(char **strv) { @@ -139,16 +129,12 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(FILE *, fclose); DEFINE_TRIVIAL_CLEANUP_FUNC(DIR *, closedir); #define _cleanup_closedir_ _cleanup_(closedirp) -DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus *, sd_bus_unref); -#define _cleanup_bus_unref_ _cleanup_(sd_bus_unrefp) +#define _cleanup_bus_flush_close_unref_ _cleanup_(sd_bus_flush_close_unrefp) -DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_slot *, sd_bus_slot_unref); #define _cleanup_bus_slot_unref_ _cleanup_(sd_bus_slot_unrefp) -DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_message *, sd_bus_message_unref); #define _cleanup_bus_message_unref_ _cleanup_(sd_bus_message_unrefp) -DEFINE_TRIVIAL_CLEANUP_FUNC(sd_event_source *, sd_event_source_unref); #define _cleanup_event_source_unref_ _cleanup_(sd_event_source_unrefp) #endif -- cgit v1.2.3