summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-03 06:12:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-03 06:12:58 +0000
commitbb296e6938f93f0d88f4b058f07cc838c104a1fe (patch)
tree82aecaa4d244a7155a198ec6e4b009a5c90648a4
parent05069d4f78187cb368206d713ba81cabd033d3d6 (diff)
downloadrsyslog-bb296e6938f93f0d88f4b058f07cc838c104a1fe.tar.gz
rsyslog-bb296e6938f93f0d88f4b058f07cc838c104a1fe.tar.xz
rsyslog-bb296e6938f93f0d88f4b058f07cc838c104a1fe.zip
fixed bug when obtaining port from /etc/services
-rw-r--r--linux/Makefile2
-rw-r--r--syslogd.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/linux/Makefile b/linux/Makefile
index f4435725..5bd22e06 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -47,7 +47,7 @@ FEATURE_PTHREADS=1
FEATURE_KLOGD=1
# Enable debug mode (much slower code)
-FEATURE_DEBUG=1
+FEATURE_DEBUG=0
# The following defines tell us where liblogging is located. This
# is only needed if we build with RFC 3195 support. By default,
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