*
* Drop a reference of a udev queue context. If the refcount reaches zero,
* the resources of the queue context will be released.
+ *
+ * Returns: the passed queue context if it has still an active reference, or #NULL otherwise.
**/
-_public_ void udev_queue_unref(struct udev_queue *udev_queue)
+_public_ struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
- return;
+ return NULL;
udev_queue->refcount--;
if (udev_queue->refcount > 0)
- return;
+ return udev_queue;
udev_list_cleanup(&udev_queue->queue_list);
free(udev_queue);
+ return NULL;
}
/**
* udev_queue_get_kernel_seqnum:
* @udev_queue: udev queue context
*
- * Returns: the current kernel event sequence number.
+ * Get the current kernel event sequence number.
+ *
+ * Returns: the sequence number.
**/
_public_ unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue)
{
return NULL;
if (udev_queue_read_seqnum(queue_file, seqnum_start) < 0) {
- err(udev_queue->udev, "corrupt queue file\n");
+ udev_err(udev_queue->udev, "corrupt queue file\n");
fclose(queue_file);
return NULL;
}
* udev_queue_get_udev_seqnum:
* @udev_queue: udev queue context
*
- * Returns: the last known udev event sequence number.
+ * Get the last known udev event sequence number.
+ *
+ * Returns: the sequence number.
**/
_public_ unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
{
* udev_queue_get_udev_is_active:
* @udev_queue: udev queue context
*
+ * Check if udev is active on the system.
+ *
* Returns: a flag indicating if udev is active.
**/
_public_ int udev_queue_get_udev_is_active(struct udev_queue *udev_queue)
* udev_queue_get_queue_is_empty:
* @udev_queue: udev queue context
*
+ * Check if udev is currently processing any events.
+ *
* Returns: a flag indicating if udev is currently handling events.
**/
_public_ int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue)
* @start: first event sequence number
* @end: last event sequence number
*
+ * Check if udev is currently processing any events in a given sequence number range.
+ *
* Returns: a flag indicating if any of the sequence numbers in the given range is currently active.
**/
_public_ int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
* @udev_queue: udev queue context
* @seqnum: sequence number
*
+ * Check if udev is currently processing a given sequence number.
+ *
* Returns: a flag indicating if the given sequence number is currently active.
**/
_public_ int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
* udev_queue_get_queued_list_entry:
* @udev_queue: udev queue context
*
- * Returns: the first entry of the list of queued events.
+ * Get the first entry of the list of queued events.
+ *
+ * Returns: a udev_list_entry.
**/
_public_ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue)
{
return udev_list_get_entry(&udev_queue->queue_list);
}
-
-struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue);
-_public_ struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue)
-{
- err(udev_queue->udev, "udev_queue_get_failed_list_entry() does not return anything; failed events are not recorded\n");
- errno = ENOSYS;
- return NULL;
-}