about summary refs log tree commit diff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-08-08 20:58:35 +0000
committerUlrich Drepper <drepper@redhat.com>2005-08-08 20:58:35 +0000
commitcc46d02a4537b5132cb08ed97ae4e71a42c0d90b (patch)
tree522ea6ff7e1b2a8049d7c042a19d2c461d5ffdfa /nscd
parentba4ee8de71b6a2f16ea0456ebeedf3991af7d9cf (diff)
downloadglibc-cc46d02a4537b5132cb08ed97ae4e71a42c0d90b.tar.gz
glibc-cc46d02a4537b5132cb08ed97ae4e71a42c0d90b.tar.xz
glibc-cc46d02a4537b5132cb08ed97ae4e71a42c0d90b.zip
(cache_add): Comment hash table and header to disk.
Diffstat (limited to 'nscd')
-rw-r--r--nscd/cache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nscd/cache.c b/nscd/cache.c
index efac4b3bcc..800b7ecf27 100644
--- a/nscd/cache.c
+++ b/nscd/cache.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -169,6 +169,12 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
   if (nentries > table->head->maxnentries)
     table->head->maxnentries = nentries;
 
+  if (table->persistent)
+    // XXX async OK?
+    msync ((void *) table->head,
+	   (char *) &table->head->array[hash] - (char *) table->head
+	   + sizeof (ref_t), MS_ASYNC);
+
   return 0;
 }