summaryrefslogtreecommitdiff
path: root/nscd/connections.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-09-22 21:21:10 +0000
committerRoland McGrath <roland@gnu.org>2004-09-22 21:21:10 +0000
commitb5707b44d25d7af61b0338c2a2206c036eaf7337 (patch)
treed8b9e865cbc78d64835a63959370865a2a043223 /nscd/connections.c
parent4ff389feb39f2eb649530b843d478c80c27ab4cf (diff)
Changes and additions migrated from cvs.devel.redhat.com:/cvs/devel/glibc to fedora-branch
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index 164fdfbc84..fe65b661d7 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -984,7 +984,6 @@ start_threads (void)
nscd_run ((void *) 0);
}
-
/* Look up the uid, gid, and supplementary groups to run nscd as. When
this function is called, we are not listening on the nscd socket yet so
we can just use the ordinary lookup functions without causing a lockup */
@@ -1046,3 +1045,18 @@ finish_drop_privileges (void)
exit (1);
}
}
+
+/* Handle the HUP signal which will force a dump of the cache */
+void
+sighup_handler (int signum)
+{
+ /* Prune the password database */
+ prune_cache (&dbs[pwddb], LONG_MAX);
+
+ /* Prune the group database */
+ prune_cache (&dbs[grpdb], LONG_MAX);
+
+ /* Prune the host database */
+ prune_cache (&dbs[hstdb], LONG_MAX);
+}
+