diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-06-12 22:40:27 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-06-12 22:40:27 +0000 |
commit | 5228ba2fe881133ccc0f9b3ad8a1ebbe9112a6f2 (patch) | |
tree | 226b31672d444eaf3ad88b7ee96bbf55d660b8dd /nscd/cache.c | |
parent | 5a337776da5b7ff1dbbf0fdcd093a3b6af2cdf83 (diff) | |
download | glibc-5228ba2fe881133ccc0f9b3ad8a1ebbe9112a6f2.tar glibc-5228ba2fe881133ccc0f9b3ad8a1ebbe9112a6f2.tar.gz glibc-5228ba2fe881133ccc0f9b3ad8a1ebbe9112a6f2.tar.bz2 glibc-5228ba2fe881133ccc0f9b3ad8a1ebbe9112a6f2.zip |
* nscd/nscd.h (struct database_dyn): Add inotify_descr and clear_cache
fields.
* nscd/connections.c (inotify_fd): New variable.
(nscd_init): Try to open an inotify descriptor.
If successful, watch files for databases using inotify instead of
having prune threads stat the files.
(nscd_run_prune): Recognize clear_cache flag being set and call
prune_cache appropriately.
(main_loop_poll): Add inotify descriptor to wait set and handle the
reported changes.
(main_loop_epoll): Likewise.
* nscd/cache.c (prune_cache): Don't stat files for databases if
inotify is used.
* sysdeps/unix/sysv/linux/Makefile [subdir=nscd]
(CFLAGS-connections.c): Add -DHAVE_INOTIFY.
Diffstat (limited to 'nscd/cache.c')
-rw-r--r-- | nscd/cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/cache.c b/nscd/cache.c index 2faaf3403e..cd6e6b4440 100644 --- a/nscd/cache.c +++ b/nscd/cache.c @@ -274,7 +274,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd) /* If we check for the modification of the underlying file we invalidate the entries also in this case. */ - if (table->check_file && now != LONG_MAX) + if (table->inotify_descr < 0 && table->check_file && now != LONG_MAX) { struct stat64 st; |