chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-event: introduce concept of "floating" event sources
[elogind.git]
/
src
/
libsystemd
/
sd-bus
/
bus-slot.c
diff --git
a/src/libsystemd/sd-bus/bus-slot.c
b/src/libsystemd/sd-bus/bus-slot.c
index 8e38992ec4abc512e6c0a57bd4dc9591dbcf23ab..5e927511d5decc78039c620b516c338151998fc2 100644
(file)
--- a/
src/libsystemd/sd-bus/bus-slot.c
+++ b/
src/libsystemd/sd-bus/bus-slot.c
@@
-67,12
+67,11
@@
void bus_slot_disconnect(sd_bus_slot *slot) {
assert(slot);
assert(slot);
- switch (slot->type) {
-
- case _BUS_SLOT_DISCONNECTED:
- /* Already disconnected... */
+ if (!slot->bus)
return;
return;
+ switch (slot->type) {
+
case BUS_REPLY_CALLBACK:
if (slot->reply_callback.cookie != 0)
case BUS_REPLY_CALLBACK:
if (slot->reply_callback.cookie != 0)
@@
-181,10
+180,14
@@
void bus_slot_disconnect(sd_bus_slot *slot) {
}
break;
}
break;
+
+ default:
+ assert_not_reached("Wut? Unknown slot type?");
}
}
+
bus = slot->bus;
bus = slot->bus;
- slot->type = _BUS_SLOT_
DISCONNECTE
D;
+ slot->type = _BUS_SLOT_
INVALI
D;
slot->bus = NULL;
LIST_REMOVE(slots, bus->slots, slot);
slot->bus = NULL;
LIST_REMOVE(slots, bus->slots, slot);
@@
-235,7
+238,7
@@
_public_ void *sd_bus_slot_set_userdata(sd_bus_slot *slot, void *userdata) {
_public_ sd_bus_message *sd_bus_slot_get_current_message(sd_bus_slot *slot) {
assert_return(slot, NULL);
_public_ sd_bus_message *sd_bus_slot_get_current_message(sd_bus_slot *slot) {
assert_return(slot, NULL);
- assert_return(slot->type
!= _BUS_SLOT_DISCONNECTED
, NULL);
+ assert_return(slot->type
>= 0
, NULL);
if (slot->bus->current_slot != slot)
return NULL;
if (slot->bus->current_slot != slot)
return NULL;