* nscd/cache.c (prune_cache): If cache is empty, instruct caller
to wake up in 24 hours.
This commit is contained in:
parent
43850227c9
commit
f9e2261b7e
|
@ -1,5 +1,8 @@
|
||||||
2007-11-14 Ulrich Drepper <drepper@redhat.com>
|
2007-11-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/cache.c (prune_cache): If cache is empty, instruct caller
|
||||||
|
to wake up in 24 hours.
|
||||||
|
|
||||||
* nscd/gai.c (__ioctl): Define. Include check_native.c.
|
* nscd/gai.c (__ioctl): Define. Include check_native.c.
|
||||||
|
|
||||||
2007-11-13 Ulrich Drepper <drepper@redhat.com>
|
2007-11-13 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
|
@ -288,7 +288,8 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
|
||||||
dbg_log (_("pruning %s cache; time %ld"),
|
dbg_log (_("pruning %s cache; time %ld"),
|
||||||
dbnames[table - dbs], (long int) now);
|
dbnames[table - dbs], (long int) now);
|
||||||
|
|
||||||
time_t next_timeout = LONG_MAX;
|
#define NO_TIMEOUT LONG_MAX
|
||||||
|
time_t next_timeout = NO_TIMEOUT;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ref_t run = table->head->array[--cnt];
|
ref_t run = table->head->array[--cnt];
|
||||||
|
@ -474,5 +475,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
|
||||||
if (any)
|
if (any)
|
||||||
gc (table);
|
gc (table);
|
||||||
|
|
||||||
return next_timeout - now;
|
/* If there is no entry in the database and we therefore have no new
|
||||||
|
timeout value, tell the caller to wake up in 24 hours. */
|
||||||
|
return next_timeout == NO_TIMEOUT ? 24 * 60 * 60 : next_timeout - now;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue