From 2c210d1eb88d4ab44bfce576b8fbac8e89a946f4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 23 Aug 2005 23:21:53 +0000 Subject: * nscd/connection.c (DEFAULT_DATASIZE_PER_BUCKET): Move to nscd.h. (dbs): Initialize max_db_size fields. (nscd_init): When mapping the database, use max_db_size as the mapping size even if it is bigger than the file size. * nscd/mem.c (mempool_alloc): When resizing the file make sure the limit in max_db_size is not exceeded. Don't use mremap, just posix_fallocate is enough (according to Linus). Use posix_fallocate correctly. * nscd/nscd.conf: Add max-db-size parameters. * nscd/nscd.h (struct database_dyn): Add max_db_size field. Define DEFAULT_MAX_DB_SIZE and DEFAULT_DATASIZE_PER_BUCKET. Temporarily define TEMP_FAILURE_RETRY_VAL here. * nscd/nscd_conf.c (nscd_parse_file): Parse max-db-size parameter and add sanity checks for it. * nscd/aicache.c (addhstaiX): Use send with MSG_NOSIGNAL not write to send reply. * nscd/connection.c (writeall): Likewise. (handle_request): Likewise. * nscd/grpcache.c (cache_addgr): Likewise. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nscd/nscd.c (parse_opt): Likewise. * nscd/nscd_stat.c (send_stats): Likewise. (receive_print_stats): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. --- nscd/nscd_stat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nscd/nscd_stat.c') diff --git a/nscd/nscd_stat.c b/nscd/nscd_stat.c index 43f6266..c1d0bff 100644 --- a/nscd/nscd_stat.c +++ b/nscd/nscd_stat.c @@ -133,7 +133,8 @@ send_stats (int fd, struct database_dyn dbs[lastdb]) if (selinux_enabled) nscd_avc_cache_stats (&data.cstats); - if (TEMP_FAILURE_RETRY (write (fd, &data, sizeof (data))) != sizeof (data)) + if (TEMP_FAILURE_RETRY (send (fd, &data, sizeof (data), MSG_NOSIGNAL)) + != sizeof (data)) { char buf[256]; dbg_log (_("cannot write statistics: %s"), @@ -180,7 +181,8 @@ receive_print_stats (void) req.version = NSCD_VERSION; req.type = GETSTAT; req.key_len = 0; - nbytes = TEMP_FAILURE_RETRY (write (fd, &req, sizeof (request_header))); + nbytes = TEMP_FAILURE_RETRY (send (fd, &req, sizeof (request_header), + MSG_NOSIGNAL)); if (nbytes != sizeof (request_header)) { int err = errno; -- cgit v1.1