summaryrefslogtreecommitdiffhomepage
path: root/src/sock.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2001-10-22 16:52:34 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2001-10-22 16:52:34 +0000
commita6a026cb9e7a57ccae85d7ddebf94149c9f28aae (patch)
tree1393f437afaff1ac3088b97290820436efcfcc55 /src/sock.c
parent358b2781af5855e29fb9a37599e1154308117668 (diff)
Changed the getpeer_*() functions to return the reason why the name or IP
address could not be looked up.
Diffstat (limited to 'src/sock.c')
-rw-r--r--src/sock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sock.c b/src/sock.c
index 6e5f839..6594ecc 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -1,4 +1,4 @@
-/* $Id: sock.c,v 1.9 2001-10-22 15:56:11 rjkaes Exp $
+/* $Id: sock.c,v 1.10 2001-10-22 16:52:34 rjkaes Exp $
*
* Sockets are created and destroyed here. When a new connection comes in from
* a client, we need to copy the socket and the create a second socket to the
@@ -161,7 +161,7 @@ char *getpeer_ip(int fd, char *ipaddr)
assert(ipaddr != NULL);
if (getpeername(fd, (struct sockaddr*)&name, &namelen) != 0) {
- log_message(LOG_ERR, "Connect: 'could not get peer name'");
+ log_message(LOG_ERR, "geetpeer_ip: 'could not get peer name' (\"%s\": %d)", strerror(errno), errno);
*ipaddr = '\0';
} else {
strlcpy(ipaddr,
@@ -186,7 +186,7 @@ char *getpeer_string(int fd, char *string)
assert(string != NULL);
if (getpeername(fd, (struct sockaddr *)&name, &namelen) != 0) {
- log_message(LOG_ERR, "Connect: 'could not get peer name'");
+ log_message(LOG_ERR, "getpeer_string: 'could not get peer name' (\"%s\": %d)", strerror(errno), errno);
*string = '\0';
} else {
LOCK();