From 4b89195f0c61404a30c8c688df44ce2b3796c370 Mon Sep 17 00:00:00 2001 From: Karolin Seeger Date: Fri, 26 Mar 2010 15:14:35 +0100 Subject: [PATCH] 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 --- source3/lib/util_sock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 08cbced1e51..ced76ebca98 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; } -- 2.11.4.GIT