mirror of https://github.com/nirenjan/libx52.git
Allow NULL cb_handle in libx52_hotplug_register_callback
This allows the caller to register a callback and forget about it. This is useful in cases where a particular callback needs to be run everytime, and there is no point in deregistering it until the application terminates, at which point `libx52_hotplug_exit` will take care of the cleanup.debian-packaging
parent
79b1f930b8
commit
cb050f2c30
|
@ -328,7 +328,10 @@ int libx52_hotplug_register_callback(libx52_hotplug_service *svc,
|
||||||
/* Insert the node into the callbacks list */
|
/* Insert the node into the callbacks list */
|
||||||
svc->callbacks[i] = hdl;
|
svc->callbacks[i] = hdl;
|
||||||
|
|
||||||
*cb_handle = hdl;
|
if (cb_handle != NULL) {
|
||||||
|
*cb_handle = hdl;
|
||||||
|
}
|
||||||
|
|
||||||
return LIBX52_SUCCESS;
|
return LIBX52_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue