summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2010-03-26 15:14:35 +0100
committerKarolin Seeger <kseeger@samba.org>2010-03-26 15:24:21 +0100
commit4b89195f0c61404a30c8c688df44ce2b3796c370 (patch)
tree27dff31aa9828983cd9238b11fcf70efb560b562
parenta6f25fc635dce0b67422b271e09467e9ea854489 (diff)
downloadsamba-4b89195f0c61404a30c8c688df44ce2b3796c370.tar.gz
samba-4b89195f0c61404a30c8c688df44ce2b3796c370.tar.bz2
samba-4b89195f0c61404a30c8c688df44ce2b3796c370.zip
s3-util_sock: Rise debug level for getpeername failed messages.
Don't show all getpeername failed messages in debug level 0 and 1. Karolin Signed-off-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/lib/util_sock.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 08cbced1e5..ced76ebca9 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -155,8 +155,9 @@ int get_socket_port(int fd)
}
if (getsockname(fd, (struct sockaddr *)&sa, &length) < 0) {
- DEBUG(0,("getpeername failed. Error was %s\n",
- strerror(errno) ));
+ int level = (errno == ENOTCONN) ? 2 : 0;
+ DEBUG(level, ("getpeername failed. Error was %s\n",
+ strerror(errno)));
return -1;
}
@@ -1428,8 +1429,9 @@ static const char *get_peer_addr_internal(int fd,
}
if (getpeername(fd, (struct sockaddr *)pss, plength) < 0) {
- DEBUG(0,("getpeername failed. Error was %s\n",
- strerror(errno) ));
+ int level = (errno == ENOTCONN) ? 2 : 0;
+ DEBUG(level, ("getpeername failed. Error was %s\n",
+ strerror(errno)));
return addr_buf;
}