int fd;
};
-static gint __compare_timer_id(gconstpointer data, gconstpointer input)
-{
- guint id= *(guint *)data;
- guint input_id = *(guint *)input;
-
- return (id == input_id) ? 0 : -1;
-}
-
static bool find_timer(int id)
{
GList *node;
- node = g_list_find_custom(g_timer_list, &id, __compare_timer_id);
+ node = g_list_find(g_timer_list, GINT_TO_POINTER(id));
if (!node)
return false;
if (!timer_id)
return -EPERM;
- g_timer_list = g_list_append(g_timer_list,
- (gpointer)&timer_id);
+ g_timer_list = g_list_append(g_timer_list, GINT_TO_POINTER(timer_id));
return timer_id;
}
return;
g_source_remove(timer_id);
- g_timer_list = g_list_remove(g_timer_list,
- (gpointer)&timer_id);
+ g_timer_list = g_list_remove(g_timer_list, GINT_TO_POINTER(timer_id));
}
struct udev_monitor *add_uevent_handler(
g_source_remove(uevent_data->fd);
uevent_data->fd = -1;
+ free(uevent_data);
}
void init_timer(void)
*/
g_list_free(g_timer_list);
- g_list_free(g_uevent_list);
+ g_list_free_full(g_uevent_list, free);
g_timer_list = NULL;
g_uevent_list = NULL;