- return sd_bus_call_async(bus, m, hello_callback, NULL, 0, &bus->hello_serial);
+ return sd_bus_call_async(bus, m, hello_callback, NULL, 0, &bus->hello_cookie);
-#ifdef ENABLE_KDBUS
- r = sd_bus_set_address(b, "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket");
-#else
- r = sd_bus_set_address(b, "unix:path=/run/dbus/system_bus_socket");
-#endif
-
+ r = sd_bus_set_address(b, DEFAULT_SYSTEM_BUS_PATH);
- asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus", (unsigned long) getuid(), ee);
+ asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, (unsigned long) getuid(), ee);
- b->address = strjoin("unix:path=", ee, "/bus", NULL);
+ asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
/* We'll leave the fd open in case this is a kernel bus, since
* there might still be memblocks around that reference this
/* We'll leave the fd open in case this is a kernel bus, since
* there might still be memblocks around that reference this
- if (bus->is_kernel || bus->windex >= BUS_MESSAGE_SIZE(m))
- log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s serial=%lu reply_serial=%lu error=%s",
+ if (bus->is_kernel || *idx >= BUS_MESSAGE_SIZE(m))
+ log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s",
bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)),
strna(sd_bus_message_get_destination(m)),
strna(sd_bus_message_get_path(m)),
strna(sd_bus_message_get_interface(m)),
strna(sd_bus_message_get_member(m)),
bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)),
strna(sd_bus_message_get_destination(m)),
strna(sd_bus_message_get_path(m)),
strna(sd_bus_message_get_interface(m)),
strna(sd_bus_message_get_member(m)),
- (unsigned long) m->header->serial,
- (unsigned long) m->reply_serial,
+ (unsigned long) BUS_MESSAGE_COOKIE(m),
+ (unsigned long) m->reply_cookie,
m->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
r = bus_seal_message(bus, m, 0);
m->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
r = bus_seal_message(bus, m, 0);
/* If this is a reply and no reply was requested, then let's
* suppress this, if we can */
/* If this is a reply and no reply was requested, then let's
* suppress this, if we can */
-_public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, uint64_t *serial) {
+_public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, uint64_t *cookie) {
struct reply_callback *c;
assert_return(bus, -EINVAL);
struct reply_callback *c;
assert_return(bus, -EINVAL);
/* Found a match! */
memmove(bus->rqueue + i, bus->rqueue + i + 1, sizeof(sd_bus_message*) * (bus->rqueue_size - i - 1));
/* Found a match! */
memmove(bus->rqueue + i, bus->rqueue + i + 1, sizeof(sd_bus_message*) * (bus->rqueue_size - i - 1));
bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)),
strna(sd_bus_message_get_destination(m)),
strna(sd_bus_message_get_path(m)),
strna(sd_bus_message_get_interface(m)),
strna(sd_bus_message_get_member(m)),
bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)),
strna(sd_bus_message_get_destination(m)),
strna(sd_bus_message_get_path(m)),
strna(sd_bus_message_get_interface(m)),
strna(sd_bus_message_get_member(m)),
- (unsigned long) m->header->serial,
- (unsigned long) m->reply_serial,
+ (unsigned long) BUS_MESSAGE_COOKIE(m),
+ (unsigned long) m->reply_cookie,
strna(m->error.message));
r = process_hello(bus, m);
strna(m->error.message));
r = process_hello(bus, m);
/* First, fail all outstanding method calls */
r = bus_message_new_synthetic_error(
bus,
/* First, fail all outstanding method calls */
r = bus_message_new_synthetic_error(
bus,