summaryrefslogtreecommitdiff
path: root/src/systemd/sd-bus.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-01-17 15:51:08 +0100
committerLennart Poettering <lennart@poettering.net>2019-01-17 16:12:38 +0100
commitbd62b7448623fbe36665e089977731efb55524c0 (patch)
treea05c81cd5f93dac75f1649414f1344272775979e /src/systemd/sd-bus.h
parent80aff27aeb7bbe694395df56be300ff5a4ea4e02 (diff)
downloadsystemd-bd62b7448623fbe36665e089977731efb55524c0.tar.gz
sd-bus: add sd_bus_close_unref() helper
It's similar to sd_bus_flush_close_unref() but doesn't do the flushing. This is useful since this will still discnnect the connection properly but not synchronously wait for the peer to take our messages. Primary usecase is within _cleanup_() expressions where synchronously waiting on the peer is not OK.
Diffstat (limited to 'src/systemd/sd-bus.h')
-rw-r--r--src/systemd/sd-bus.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index 4c1acab9f3..129cc93328 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -170,6 +170,7 @@ void sd_bus_close(sd_bus *bus);
sd_bus *sd_bus_ref(sd_bus *bus);
sd_bus *sd_bus_unref(sd_bus *bus);
+sd_bus *sd_bus_close_unref(sd_bus *bus);
sd_bus *sd_bus_flush_close_unref(sd_bus *bus);
void sd_bus_default_flush_close(void);
@@ -493,6 +494,7 @@ int sd_bus_track_get_destroy_callback(sd_bus_track *s, sd_bus_destroy_t *ret);
/* Define helpers so that __attribute__((cleanup(sd_bus_unrefp))) and similar may be used. */
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_unref);
+_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_close_unref);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_flush_close_unref);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_slot, sd_bus_slot_unref);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_message, sd_bus_message_unref);