X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap_r%2Frq.c;h=ccd255949e003e70500443f85231c555b49d41d7;hb=e22dc83ac096d1239a6903199f5dc3231b0f444b;hp=99daef6ca1baefe6f59ffc54d7b6f8870650e2cb;hpb=b978e779326fe7f3cf52c6a9b7c0f00916e8bfaf;p=openldap diff --git a/libraries/libldap_r/rq.c b/libraries/libldap_r/rq.c index 99daef6ca1..ccd255949e 100644 --- a/libraries/libldap_r/rq.c +++ b/libraries/libldap_r/rq.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2005 The OpenLDAP Foundation. + * Copyright 2003-2009 The OpenLDAP Foundation. * Portions Copyright 2003 IBM Corporation. * All rights reserved. * @@ -55,7 +55,7 @@ ldap_pvt_runqueue_insert( entry->arg = arg; entry->tname = tname; entry->tspec = tspec; - LDAP_STAILQ_INSERT_TAIL( &rq->task_list, entry, tnext ); + LDAP_STAILQ_INSERT_HEAD( &rq->task_list, entry, tnext ); } return entry; } @@ -99,20 +99,16 @@ ldap_pvt_runqueue_remove( struct re_s* ldap_pvt_runqueue_next_sched( struct runqueue_s* rq, - struct timeval** next_run + struct timeval* next_run ) { struct re_s* entry; entry = LDAP_STAILQ_FIRST( &rq->task_list ); - if ( entry == NULL ) { - *next_run = NULL; - return NULL; - } else if ( entry->next_sched.tv_sec == 0 ) { - *next_run = NULL; + if ( entry == NULL || entry->next_sched.tv_sec == 0 ) { return NULL; } else { - *next_run = &entry->next_sched; + *next_run = entry->next_sched; return entry; } }