r5273: fixed another bug in the code that keeps timed events
authorAndrew Tridgell <tridge@samba.org>
Tue, 8 Feb 2005 01:01:22 +0000 (01:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:35 +0000 (13:09 -0500)
sorted. Hopefully it really works now :-)
(This used to be commit 34e1a3ad7849df913584074ec406c2fcc40212fc)

source4/lib/events/events.c

index 23026166a277074612b445c9b455cdc130c77964..cf165c99dcd073463b5c9115e7ca8b22e2b6428b 100644 (file)
@@ -317,8 +317,8 @@ struct timed_event *event_add_timed(struct event_context *ev, TALLOC_CTX *mem_ct
                DLIST_ADD(ev->timed_events, e);
        } else {
                for (te=ev->timed_events;te && te->next;te=te->next) {
-                       if (!timeval_is_zero(&te->next_event) &&
-                           timeval_compare(&te->next_event, &e->next_event) < 0) {
+                       if (!timeval_is_zero(&te->next->next_event) &&
+                           timeval_compare(&te->next->next_event, &e->next_event) < 0) {
                                break;
                        }
                }