diff options
author | Dmitry Shmidt <> | 2009-04-16 11:38:56 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-16 11:38:56 -0700 |
commit | dc9507e42030320bf0a3dbb7d3f733d43bc94ede (patch) | |
tree | 7ecca1d8fe0bca8284dbe11959b9bfd1b95814a7 /eloop.c | |
parent | 1d4083524ea28c357a8dde843a211f8a65fa630b (diff) | |
download | wpa_supplicant-dc9507e42030320bf0a3dbb7d3f733d43bc94ede.tar.gz |
AI 146505: am: CL 146027 Update wpa_supplicant from 0.5.10 to 0.5.11
Original author: dimitrysh
Automated import of CL 146505
Diffstat (limited to 'eloop.c')
-rw-r--r-- | eloop.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -232,7 +232,10 @@ int eloop_register_timeout(unsigned int secs, unsigned int usecs, timeout = os_malloc(sizeof(*timeout)); if (timeout == NULL) return -1; - os_get_time(&timeout->time); + if (os_get_time(&timeout->time) < 0) { + os_free(timeout); + return -1; + } timeout->time.sec += secs; timeout->time.usec += usecs; while (timeout->time.usec >= 1000000) { @@ -302,6 +305,25 @@ int eloop_cancel_timeout(eloop_timeout_handler handler, } +int eloop_is_timeout_registered(eloop_timeout_handler handler, + void *eloop_data, void *user_data) +{ + struct eloop_timeout *tmp; + + tmp = eloop.timeout; + while (tmp != NULL) { + if (tmp->handler == handler && + tmp->eloop_data == eloop_data && + tmp->user_data == user_data) + return 1; + + tmp = tmp->next; + } + + return 0; +} + + #ifndef CONFIG_NATIVE_WINDOWS static void eloop_handle_alarm(int sig) { |