summaryrefslogtreecommitdiff
path: root/nscd/nscd_stat.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /nscd/nscd_stat.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'nscd/nscd_stat.c')
-rw-r--r--nscd/nscd_stat.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/nscd/nscd_stat.c b/nscd/nscd_stat.c
index 7f6bd1c83e..9231642278 100644
--- a/nscd/nscd_stat.c
+++ b/nscd/nscd_stat.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
@@ -24,7 +24,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/socket.h>
#include <unistd.h>
#include <libintl.h>
@@ -76,10 +75,6 @@ struct statdata
int debug_level;
time_t runtime;
unsigned long int client_queued;
- int nthreads;
- int max_nthreads;
- int paranoia;
- time_t restart_interval;
int ndbs;
struct dbstat dbs[lastdb];
#ifdef HAVE_SELINUX
@@ -98,10 +93,6 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
data.debug_level = debug_level;
data.runtime = time (NULL) - start_time;
data.client_queued = client_queued;
- data.nthreads = nthreads;
- data.max_nthreads = max_nthreads;
- data.paranoia = paranoia;
- data.restart_interval = restart_interval;
data.ndbs = lastdb;
for (cnt = 0; cnt < lastdb; ++cnt)
@@ -134,8 +125,7 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
if (selinux_enabled)
nscd_avc_cache_stats (&data.cstats);
- if (TEMP_FAILURE_RETRY (send (fd, &data, sizeof (data), MSG_NOSIGNAL))
- != sizeof (data))
+ if (TEMP_FAILURE_RETRY (write (fd, &data, sizeof (data))) != sizeof (data))
{
char buf[256];
dbg_log (_("cannot write statistics: %s"),
@@ -153,8 +143,8 @@ receive_print_stats (void)
int fd;
int i;
uid_t uid = getuid ();
- const char *yesstr = _("yes");
- const char *nostr = _("no");
+ const char *yesstr = nl_langinfo (YESSTR);
+ const char *nostr = nl_langinfo (NOSTR);
/* Find out whether there is another user but root allowed to
request statistics. */
@@ -182,8 +172,7 @@ receive_print_stats (void)
req.version = NSCD_VERSION;
req.type = GETSTAT;
req.key_len = 0;
- nbytes = TEMP_FAILURE_RETRY (send (fd, &req, sizeof (request_header),
- MSG_NOSIGNAL));
+ nbytes = TEMP_FAILURE_RETRY (write (fd, &req, sizeof (request_header)));
if (nbytes != sizeof (request_header))
{
int err = errno;
@@ -241,9 +230,8 @@ receive_print_stats (void)
"%15lu number of times clients had to wait\n"
"%15s paranoia mode enabled\n"
"%15lu restart internal\n"),
- data.nthreads, data.max_nthreads, data.client_queued,
- data.paranoia ? yesstr : nostr,
- (unsigned long int) data.restart_interval);
+ nthreads, max_nthreads, data.client_queued,
+ paranoia ? yesstr : nostr, (unsigned long int) restart_interval);
for (i = 0; i < lastdb; ++i)
{