Exemple #1
0
void eloop_destroy(void)
{
	struct eloop_timeout *timeout, *prev;
	struct os_time now;

	os_get_time(&now);
	dl_list_for_each_safe(timeout, prev, &eloop.timeout,
			      struct eloop_timeout, list) {
		int sec, usec;
		sec = timeout->time.sec - now.sec;
		usec = timeout->time.usec - now.usec;
		if (timeout->time.usec < now.usec) {
			sec--;
			usec += 1000000;
		}
		wpa_printf(MSG_INFO, "ELOOP: remaining timeout: %d.%06d "
			   "eloop_data=%p user_data=%p handler=%p",
			   sec, usec, timeout->eloop_data, timeout->user_data,
			   timeout->handler);
		wpa_trace_dump_funcname("eloop unregistered timeout handler",
					timeout->handler);
		wpa_trace_dump("eloop timeout", timeout);
		eloop_remove_timeout(timeout);
	}
	eloop_sock_table_destroy(&eloop.readers);
	eloop_sock_table_destroy(&eloop.writers);
	eloop_sock_table_destroy(&eloop.exceptions);
	os_free(eloop.signals);
}
void eloop_destroy(void)
{
    struct eloop_timeout *timeout, *prev;
    struct os_time now;

    timeout = eloop.timeout;
    if (timeout)
        os_get_time(&now);
    while (timeout != NULL) {
        int sec, usec;
        prev = timeout;
        timeout = timeout->next;
        sec = prev->time.sec - now.sec;
        usec = prev->time.usec - now.usec;
        if (prev->time.usec < now.usec) {
            sec--;
            usec += 1000000;
        }
        printf("ELOOP: remaining timeout: %d.%06d eloop_data=%p "
               "user_data=%p handler=%p\n",
               sec, usec, prev->eloop_data, prev->user_data,
               prev->handler);
        os_free(prev);
    }
    eloop_sock_table_destroy(&eloop.readers);
    eloop_sock_table_destroy(&eloop.writers);
    eloop_sock_table_destroy(&eloop.exceptions);
    os_free(eloop.signals);
}
void eloop_destroy(void)
{
	struct eloop_timeout *timeout, *prev;

	timeout = eloop.timeout;
	while (timeout != NULL) {
		prev = timeout;
		timeout = timeout->next;
		free(prev);
	}
	eloop_sock_table_destroy(&eloop.readers);
	eloop_sock_table_destroy(&eloop.writers);
	eloop_sock_table_destroy(&eloop.exceptions);
	free(eloop.signals);
}