2001-07-16  Ulrich Drepper  <drepper@redhat.com>

	* nscd/connections.c: Print messages caused by user application
	only if debug_level > 0.
	* nscd/grpcache.c: Likewise.
	* nscd/hstcache.c: Likewise.
	* nscd/pwdcache.c: Likewise.
This commit is contained in:
Ulrich Drepper 2001-07-17 01:37:42 +00:00
parent 774a8fe8b4
commit 98e75a1c9c
5 changed files with 29 additions and 15 deletions

View File

@ -1,3 +1,11 @@
2001-07-16 Ulrich Drepper <drepper@redhat.com>
* nscd/connections.c: Print messages caused by user application
only if debug_level > 0.
* nscd/grpcache.c: Likewise.
* nscd/hstcache.c: Likewise.
* nscd/pwdcache.c: Likewise.
2001-07-13 H.J. Lu <hjl@gnu.org> 2001-07-13 H.J. Lu <hjl@gnu.org>
* sysdeps/mips/dl-machine.h (MAP_BASE_ADDR): Removed. * sysdeps/mips/dl-machine.h (MAP_BASE_ADDR): Removed.

View File

@ -222,9 +222,10 @@ handle_request (int fd, request_header *req, void *key, uid_t uid)
if (req->version != NSCD_VERSION) if (req->version != NSCD_VERSION)
{ {
dbg_log (_("\ if (debug_level > 0)
dbg_log (_("\
cannot handle old request version %d; current version is %d"), cannot handle old request version %d; current version is %d"),
req->version, NSCD_VERSION); req->version, NSCD_VERSION);
return; return;
} }
@ -254,7 +255,8 @@ cannot handle old request version %d; current version is %d"),
/* No, sent the prepared record. */ /* No, sent the prepared record. */
if (TEMP_FAILURE_RETRY (write (fd, db->disabled_iov->iov_base, if (TEMP_FAILURE_RETRY (write (fd, db->disabled_iov->iov_base,
db->disabled_iov->iov_len)) db->disabled_iov->iov_len))
!= db->disabled_iov->iov_len) != db->disabled_iov->iov_len
&& debug_level > 0)
{ {
/* We have problems sending the result. */ /* We have problems sending the result. */
char buf[256]; char buf[256];
@ -275,7 +277,8 @@ cannot handle old request version %d; current version is %d"),
{ {
/* Hurray it's in the cache. */ /* Hurray it's in the cache. */
if (TEMP_FAILURE_RETRY (write (fd, cached->packet, cached->total)) if (TEMP_FAILURE_RETRY (write (fd, cached->packet, cached->total))
!= cached->total) != cached->total
&& debug_level > 0)
{ {
/* We have problems sending the result. */ /* We have problems sending the result. */
char buf[256]; char buf[256];
@ -433,8 +436,9 @@ nscd_run (void *p)
if (TEMP_FAILURE_RETRY (read (fd, &req, sizeof (req))) if (TEMP_FAILURE_RETRY (read (fd, &req, sizeof (req)))
!= sizeof (req)) != sizeof (req))
{ {
dbg_log (_("short read while reading request: %s"), if (debug_level > 0)
strerror_r (errno, buf, sizeof (buf))); dbg_log (_("short read while reading request: %s"),
strerror_r (errno, buf, sizeof (buf)));
close (fd); close (fd);
continue; continue;
} }
@ -467,7 +471,8 @@ nscd_run (void *p)
to 1kb. */ to 1kb. */
if (req.key_len < 0 || req.key_len > 1024) if (req.key_len < 0 || req.key_len > 1024)
{ {
dbg_log (_("key length in request too long: %d"), req.key_len); if (debug_level > 0)
dbg_log (_("key length in request too long: %d"), req.key_len);
close (fd); close (fd);
continue; continue;
} }
@ -479,8 +484,9 @@ nscd_run (void *p)
if (TEMP_FAILURE_RETRY (read (fd, keybuf, req.key_len)) if (TEMP_FAILURE_RETRY (read (fd, keybuf, req.key_len))
!= req.key_len) != req.key_len)
{ {
dbg_log (_("short read while reading request key: %s"), if (debug_level > 0)
strerror_r (errno, buf, sizeof (buf))); dbg_log (_("short read while reading request key: %s"),
strerror_r (errno, buf, sizeof (buf)));
close (fd); close (fd);
continue; continue;
} }

View File

@ -1,5 +1,5 @@
/* Cache handling for group lookup. /* Cache handling for group lookup.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -187,7 +187,7 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
pthread_rwlock_unlock (&db->lock); pthread_rwlock_unlock (&db->lock);
} }
if (written != total) if (written != total && debug_level > 0)
{ {
char buf[256]; char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__, dbg_log (_("short write in %s: %s"), __FUNCTION__,

View File

@ -1,5 +1,5 @@
/* Cache handling for host lookup. /* Cache handling for host lookup.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -272,7 +272,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
pthread_rwlock_unlock (&db->lock); pthread_rwlock_unlock (&db->lock);
} }
if (written != total) if (written != total && debug_level > 0)
{ {
char buf[256]; char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__, dbg_log (_("short write in %s: %s"), __FUNCTION__,

View File

@ -1,5 +1,5 @@
/* Cache handling for passwd lookup. /* Cache handling for passwd lookup.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -183,7 +183,7 @@ cache_addpw (struct database *db, int fd, request_header *req, void *key,
pthread_rwlock_unlock (&db->lock); pthread_rwlock_unlock (&db->lock);
} }
if (written != total) if (written != total && debug_level > 0)
{ {
char buf[256]; char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__, dbg_log (_("short write in %s: %s"), __FUNCTION__,