summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d688882)
Otherwise the callback might unref the bus we are processing and destroy
the object while we are processing it.
for (char *_slash = ({ strcpy((prefix), (path)); streq((prefix), "/") ? NULL : strrchr((prefix), '/'); }) ; \
_slash && !(_slash[(_slash) == (prefix)] = 0); \
_slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))
for (char *_slash = ({ strcpy((prefix), (path)); streq((prefix), "/") ? NULL : strrchr((prefix), '/'); }) ; \
_slash && !(_slash[(_slash) == (prefix)] = 0); \
_slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))
+
+/* If we are invoking callbacks of a bus object, ensure unreffing the
+ * bus from the callback doesn't destroy the object we are working
+ * on */
+#define BUS_DONT_DESTROY(bus) \
+ _cleanup_bus_unref_ sd_bus *_dont_destroy_##bus = sd_bus_ref(bus)
const char *interface,
char **names) {
const char *interface,
char **names) {
}
int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces) {
}
int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces) {
+ BUS_DONT_DESTROY(bus);
+
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
char **i;
int r;
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
char **i;
int r;
}
int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
}
int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
int r;
/* Returns 0 when we didn't do anything. This should cause the
int r;
/* Returns 0 when we didn't do anything. This should cause the