return -EINVAL;
}
- e = strappenda(n->name, ".busname");
+ e = strjoina(n->name, ".busname");
if (!unit_has_name(UNIT(n), e)) {
log_unit_error(UNIT(n)->id, "%s's Name= setting doesn't match unit name. Refusing.", UNIT(n)->id);
return -EINVAL;
unit_notify(UNIT(n), state_translation_table[old_state], state_translation_table[state], true);
}
-static int busname_coldplug(Unit *u) {
+static int busname_coldplug(Unit *u, Hashmap *deferred_work) {
BusName *n = BUSNAME(u);
int r;
n->result = BUSNAME_SUCCESS;
busname_enter_making(n);
- return 0;
+ return 1;
}
static int busname_stop(Unit *u) {
assert(IN_SET(n->state, BUSNAME_REGISTERED, BUSNAME_LISTENING, BUSNAME_RUNNING));
busname_enter_dead(n, BUSNAME_SUCCESS);
- return 0;
+ return 1;
}
static int busname_serialize(Unit *u, FILE *f, FDSet *fds) {
* longer than necessary. */
ps = page_size();
- start = (cmd_recv.reply.offset / ps) * ps;
- delta = cmd_recv.reply.offset - start;
- sz = PAGE_ALIGN(delta + cmd_recv.reply.msg_size);
+ start = (cmd_recv.msg.offset / ps) * ps;
+ delta = cmd_recv.msg.offset - start;
+ sz = PAGE_ALIGN(delta + cmd_recv.msg.msg_size);
p = mmap(NULL, sz, PROT_READ, MAP_SHARED, n->starter_fd, start);
if (p == MAP_FAILED) {
if (p)
(void) munmap(p, sz);
- cmd_free.offset = cmd_recv.reply.offset;
+ cmd_free.offset = cmd_recv.msg.offset;
if (ioctl(n->starter_fd, KDBUS_CMD_FREE, &cmd_free) < 0)
log_unit_warning(UNIT(n)->id, "Failed to free peeked message, ignoring: %m");
}
static bool busname_supported(Manager *m) {
- int supported = -1;
+ static int supported = -1;
assert(m);
if (supported < 0)