summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2017-04-17 11:02:13 +0200
committerDavid Härdeman <david@hardeman.nu>2017-04-17 11:02:13 +0200
commite2c13faa266a4d2adededc8b720b498f914d530e (patch)
treeab88053c8056bf3fb1b62c2b32ab810f9aec83de
parentbaf81f3c2715d218678ff65db5c711f021a69eda (diff)
Update to newer sd-bus API
-rw-r--r--rcm-server-main.c2
-rw-r--r--utils.h16
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