diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-28 09:51:29 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-28 09:51:29 +0200 |
commit | b0764541ab2f2d0448ca79564479bb5865a02ecf (patch) | |
tree | 55acb1509e34b8b53ffaff542fdbde29aa2cb133 | |
parent | 22a4fed5561c940dd8ed5ba520b10035799bab18 (diff) | |
download | rsyslog-b0764541ab2f2d0448ca79564479bb5865a02ecf.tar.gz rsyslog-b0764541ab2f2d0448ca79564479bb5865a02ecf.tar.bz2 rsyslog-b0764541ab2f2d0448ca79564479bb5865a02ecf.zip |
somewhat better debug output
-rw-r--r-- | plugins/imptcp/imptcp.c | 4 | ||||
-rw-r--r-- | plugins/imttcp/imttcp.c | 4 | ||||
-rw-r--r-- | runtime/nsd_ptcp.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c index a13fd990..8150fc33 100644 --- a/plugins/imptcp/imptcp.c +++ b/plugins/imptcp/imptcp.c @@ -414,7 +414,9 @@ startupSrv(ptcpsrv_t *pSrv) #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - DBGPRINTF("error %d while binding tcp socket\n", errno); + char errStr[1024]; + rs_strerror_r(errno, errStr, sizeof(errStr)); + dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); close(sock); sock = -1; continue; diff --git a/plugins/imttcp/imttcp.c b/plugins/imttcp/imttcp.c index c72886b3..9bd11f77 100644 --- a/plugins/imttcp/imttcp.c +++ b/plugins/imttcp/imttcp.c @@ -365,7 +365,9 @@ createSrv(ttcpsrv_t *pSrv) #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - DBGPRINTF("error %d while binding tcp socket", errno); + char errStr[1024]; + rs_strerror_r(errno, errStr, sizeof(errStr)); + dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); close(sock); sock = -1; continue; diff --git a/runtime/nsd_ptcp.c b/runtime/nsd_ptcp.c index 12f891ea..d355d19c 100644 --- a/runtime/nsd_ptcp.c +++ b/runtime/nsd_ptcp.c @@ -460,7 +460,9 @@ LstnInit(netstrms_t *pNS, void *pUsr, rsRetVal(*fAddLstn)(void*,netstrm_t*), #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - dbgprintf("error %d while binding tcp socket\n", errno); + char errStr[1024]; + rs_strerror_r(errno, errStr, sizeof(errStr)); + dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); close(sock); sock = -1; continue; |