bus: when we cannot bus activate a service because we go down, drop one
message from the queue
This commit is contained in:
@@ -1476,3 +1476,16 @@ int bus_kernel_try_close(sd_bus *bus) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bus_kernel_drop_one(int fd) {
|
||||
struct kdbus_cmd_recv recv = {
|
||||
.flags = KDBUS_RECV_DROP
|
||||
};
|
||||
|
||||
assert(fd >= 0);
|
||||
|
||||
if (ioctl(fd, KDBUS_CMD_MSG_RECV, &recv) < 0)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -79,3 +79,5 @@ int kdbus_translate_request_name_flags(uint64_t sd_bus_flags, uint64_t *kdbus_fl
|
||||
int kdbus_translate_attach_flags(uint64_t sd_bus_flags, uint64_t *kdbus_flags);
|
||||
|
||||
int bus_kernel_try_close(sd_bus *bus);
|
||||
|
||||
int bus_kernel_drop_one(int fd);
|
||||
|
||||
Reference in New Issue
Block a user