From bb296e6938f93f0d88f4b058f07cc838c104a1fe Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 3 Jul 2007 06:12:58 +0000 Subject: fixed bug when obtaining port from /etc/services --- syslogd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'syslogd.c') diff --git a/syslogd.c b/syslogd.c index 2eefb399..271d70b9 100644 --- a/syslogd.c +++ b/syslogd.c @@ -6819,7 +6819,7 @@ static void init() * for the very same reason. */ static char defPort[8]; - snprintf(defPort, sizeof(defPort) * sizeof(char), "%d", sp->s_port); + snprintf(defPort, sizeof(defPort) * sizeof(char), "%d", ntohs(sp->s_port)); LogPort = defPort; } } @@ -8479,7 +8479,7 @@ int getSubString(char **ppSrc, char *pDst, size_t DstSize, char cSep) /* print out which socket we are listening on. This is only - * a debug aid. + * a debug aid. rgerhards, 2007-07-02 */ static void debugListenInfo(int fd, char *type) { @@ -8511,7 +8511,6 @@ static void debugListenInfo(int fd, char *type) type, fd, szFamily, port); return; } - perror("getpeername()"); /* we can not obtain peer info. We are just providing * debug info, so this is no reason to break the program -- cgit v1.2.3