[systemd-devel] question about sd_bus_slot_unref()
eshark
eshark77 at 163.com
Mon Aug 31 21:56:59 PDT 2015
Hi, all
I wonder why the sd_bus_slot_unref() always returns NULL? I expect that I can check whether the slot->n_ref ==0 by checking its return value.
That is
_public_ sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot) {
if (!slot)
return NULL;
assert(slot->n_ref > 0);
if (slot->n_ref > 1) {
slot->n_ref --;
//return NULL;
retrun slot;
}
bus_slot_disconnect(slot);
free(slot->description);
free(slot);
return NULL;
}
As the libsystem doesn't provide some API for the application to get the n_ref from the sd_bus_slot, maybe we can provide the same feature this way?
Thanks!
Li Cheng
More information about the systemd-devel
mailing list