]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 10 Sep 2004 20:31:41 +0000 (20:31 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 10 Sep 2004 20:31:41 +0000 (20:31 +0000)
2004-09-10  Ulrich Drepper  <drepper@redhat.com>

* nscd/nscd_stat.c: Improve output by also printing .shared and
.persistent.

* nscd/connections.c: Allow cache sharing to be really disabled.

ChangeLog
nscd/connections.c
nscd/nscd_stat.c

index cd85f0631771e709c66dd34615f38bc25c498a46..e4bf276ccd3913914afba799c4073dcc15b2fb45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-10  Ulrich Drepper  <drepper@redhat.com>
+
+       * nscd/nscd_stat.c: Improve output by also printing .shared and
+       .persistent.
+
+       * nscd/connections.c: Allow cache sharing to be really disabled.
+
 2004-09-10  Jakub Jelinek  <jakub@redhat.com>
 
        * malloc/malloc.c (_int_free): Only do arena boundary check for
index 2ca6f69cf24a7966c8ad3fcedca4e06131c290e1..11be7c3d0cf9e73c80ecaefd927ef5204d370243 100644 (file)
@@ -258,14 +258,16 @@ nscd_init (void)
                               dbnames[cnt]);
 
                    dbs[cnt].wr_fd = fd;
-                   dbs[cnt].ro_fd = open (dbs[cnt].db_filename, O_RDONLY);
                    fd = -1;
                    /* We also need a read-only descriptor.  */
-                   dbs[cnt].ro_fd = open (dbs[cnt].db_filename, O_RDONLY);
-                   if (dbs[cnt].ro_fd == -1)
-                     dbg_log (_("\
+                   if (dbs[cnt].shared)
+                     {
+                       dbs[cnt].ro_fd = open (dbs[cnt].db_filename, O_RDONLY);
+                       if (dbs[cnt].ro_fd == -1)
+                         dbg_log (_("\
 cannot create read-only descriptor for \"%s\"; no mmap"),
-                              dbs[cnt].db_filename);
+                                  dbs[cnt].db_filename);
+                     }
 
                    // XXX Shall we test whether the descriptors actually
                    // XXX point to the same file?
@@ -299,7 +301,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"),
                fd = open (dbs[cnt].db_filename,
                           O_RDWR | O_CREAT | O_EXCL | O_TRUNC,
                           S_IRUSR | S_IWUSR);
-               if (fd != -1)
+               if (fd != -1 && dbs[cnt].shared)
                  ro_fd = open (dbs[cnt].db_filename, O_RDONLY);
              }
            else
@@ -312,7 +314,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"),
 
                /* We do not need the file name anymore after we
                   opened another file descriptor in read-only mode.  */
-               if (fd != -1)
+               if (fd != -1 && dbs[cnt].shared)
                  {
                    ro_fd = open (fname, O_RDONLY);
 
@@ -344,7 +346,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"),
              {
                /* Tell the user if we could not create the read-only
                   descriptor.  */
-               if (ro_fd == -1)
+               if (ro_fd == -1 && dbs[cnt].shared)
                  dbg_log (_("\
 cannot create read-only descriptor for \"%s\"; no mmap"),
                           dbs[cnt].db_filename);
index 30f427bd20ed755588fb5b0f81717e1c21c906ea..73dafe120bc61914f9c4127192d34635ebe3af80 100644 (file)
@@ -38,6 +38,8 @@ struct dbstat
 {
   int enabled;
   int check_file;
+  int shared;
+  int persistent;
   size_t module;
 
   unsigned long int postimeout;
@@ -88,6 +90,8 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
     {
       data.dbs[cnt].enabled = dbs[cnt].enabled;
       data.dbs[cnt].check_file = dbs[cnt].check_file;
+      data.dbs[cnt].shared = dbs[cnt].shared;
+      data.dbs[cnt].persistent = dbs[cnt].persistent;
       data.dbs[cnt].module = dbs[cnt].head->module;
       data.dbs[cnt].postimeout = dbs[cnt].postimeout;
       data.dbs[cnt].negtimeout = dbs[cnt].negtimeout;
@@ -213,6 +217,9 @@ receive_print_stats (void)
       const char *enabled = nl_langinfo (data.dbs[i].enabled ? YESSTR : NOSTR);
       const char *check_file = nl_langinfo (data.dbs[i].check_file
                                            ? YESSTR : NOSTR);
+      const char *shared = nl_langinfo (data.dbs[i].shared ? YESSTR : NOSTR);
+      const char *persistent = nl_langinfo (data.dbs[i].persistent
+                                           ? YESSTR : NOSTR);
 
       if (enabled[0] == '\0')
        /* The locale does not provide this information so we have to
@@ -221,6 +228,10 @@ receive_print_stats (void)
        enabled = data.dbs[i].enabled ? _("     yes") : _("      no");
       if (check_file[0] == '\0')
        check_file = data.dbs[i].check_file ? _("     yes") : _("      no");
+      if (shared[0] == '\0')
+       shared = data.dbs[i].shared ? _("     yes") : _("      no");
+      if (persistent[0] == '\0')
+       persistent = data.dbs[i].persistent ? _("     yes") : _("      no");
 
       if (all == 0)
        /* If nothing happened so far report a 0% hit rate.  */
@@ -228,6 +239,8 @@ receive_print_stats (void)
 
       printf (_("\n%s cache:\n\n"
                "%15s  cache is enabled\n"
+               "%15s  cache is persistent\n"
+               "%15s  cache is shared\n"
                "%15zu  suggested size\n"
                "%15zu  total data pool size\n"
                "%15zu  used data pool size\n"
@@ -245,7 +258,7 @@ receive_print_stats (void)
                "%15" PRIuMAX "  number of delays on wrlock\n"
                "%15" PRIuMAX "  memory allocations failed\n"
                "%15s  check /etc/%s for changes\n"),
-             dbnames[i], enabled,
+             dbnames[i], enabled, persistent, shared,
              data.dbs[i].module,
              data.dbs[i].datasize, data.dbs[i].dataused,
              data.dbs[i].postimeout, data.dbs[i].negtimeout,