diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pthread_safe.c | 2 | ||||
-rw-r--r-- | lib/thread.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/pthread_safe.c b/lib/pthread_safe.c index 92d63074..169e5e8f 100644 --- a/lib/pthread_safe.c +++ b/lib/pthread_safe.c @@ -570,7 +570,7 @@ safe_inet_ntoa (struct in_addr in) /*------------------------------------------------------------------------------ * Construct string for given IP family/address. * - * Requires buffer of at least SU_ADDRSTRLEN characters. + * Returns struct with embedded string. */ extern str_iptoa_t siptoa(sa_family_t family, const void* address) diff --git a/lib/thread.c b/lib/thread.c index be490f9f..e8e345aa 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -1185,10 +1185,12 @@ static unsigned int thread_timer_process (struct thread_list *list, struct timeval *timenow) { struct thread *thread; + struct thread *next; unsigned int ready = 0; - for (thread = list->head; thread; thread = thread->next) + for (thread = list->head; thread; thread = next) { + next = thread->next; if (timeval_cmp (*timenow, thread->u.sands) < 0) return ready; thread_list_delete (list, thread); @@ -1206,10 +1208,12 @@ static unsigned int thread_process (struct thread_list *list) { struct thread *thread; + struct thread *next; unsigned int ready = 0; - for (thread = list->head; thread; thread = thread->next) + for (thread = list->head; thread; thread = next) { + next = thread->next; thread_list_delete (list, thread); thread->type = THREAD_READY; thread_list_add (&thread->master->ready, thread); |