From 2456406d72d9a02b97bcea7622dee93a031b97f5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 16 Apr 1999 09:38:29 +0000 Subject: Update. 1999-04-16 Ulrich Drepper * nscd/cache.c (prune_cache): Only disable file checking for future if the file does not exist. Update file_mtime if cache was flushed. --- nscd/cache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'nscd') diff --git a/nscd/cache.c b/nscd/cache.c index 52ef0383f7..e57c8686d2 100644 --- a/nscd/cache.c +++ b/nscd/cache.c @@ -142,10 +142,12 @@ prune_cache (struct database *table, time_t now) if (stat (table->filename, &st) < 0) { char buf[128]; - /* We cannot stat() the file, disable file checking. */ + /* We cannot stat() the file, disable file checking if the + file does not exist. */ dbg_log (_("cannot stat() file `%s': %s"), table->filename, strerror_r (errno, buf, sizeof (buf))); - table->check_file = 0; + if (errno == ENOENT) + table->check_file = 0; } else { @@ -153,7 +155,7 @@ prune_cache (struct database *table, time_t now) { /* The file changed. Invalidate all entries. */ now = LONG_MAX; - st.st_mtime = table->file_mtime; + table->file_mtime = st.st_mtime; } } } -- cgit v1.2.1