about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-05 21:12:46 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-05 21:12:46 +0000
commit3e6ce4d77e489c7ca333c6b56b1386b20927f678 (patch)
tree178e62caabc98304cd458d49e9c87d8a19277941
parent6789aaaa979339534384a212e21e7731eaddf985 (diff)
downloadglibc-3e6ce4d77e489c7ca333c6b56b1386b20927f678.tar.gz
glibc-3e6ce4d77e489c7ca333c6b56b1386b20927f678.tar.xz
glibc-3e6ce4d77e489c7ca333c6b56b1386b20927f678.zip
[BZ #5112]
	* nscd/connections.c (restart): Don't resync if database is
	disabled.  Patch mostly by Brian De Wolf <bldewolf@csupomona.edu>.
-rw-r--r--ChangeLog4
-rw-r--r--nscd/connections.c15
2 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 64583662e8..a1ba69b3c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-10-05  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #5112]
+	* nscd/connections.c (restart): Don't resync if database is
+	disabled.  Patch mostly by Brian De Wolf <bldewolf@csupomona.edu>.
+
 	* sysdeps/gnu/netinet/tcp.h: Define TCP_MD5SIG, TCP_MD5SIG_MAXKEYLEN,
 	struct tcp_md5sig.  Extend struct tcp_info according to recent kernels.
 
diff --git a/nscd/connections.c b/nscd/connections.c
index 11fbc03498..0687a2661f 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1284,14 +1284,15 @@ cannot change to old working directory: %s; disabling paranoia mode"),
 
   /* Synchronize memory.  */
   for (int cnt = 0; cnt < lastdb; ++cnt)
-    {
-      /* Make sure nobody keeps using the database.  */
-      dbs[cnt].head->timestamp = 0;
+    if (!dbs[cnt].enabled)
+      {
+	/* Make sure nobody keeps using the database.  */
+	dbs[cnt].head->timestamp = 0;
 
-      if (dbs[cnt].persistent)
-	// XXX async OK?
-	msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC);
-    }
+	if (dbs[cnt].persistent)
+	  // XXX async OK?
+	  msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC);
+      }
 
   /* The preparations are done.  */
   execv ("/proc/self/exe", argv);