summaryrefslogtreecommitdiffstats
path: root/omfwd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-24 13:32:25 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-24 13:32:25 +0000
commitb1ca6a351c18f38b9b6fb1b18347a099ae41ef18 (patch)
tree4fa21767d72ff73c1288e1497885a85c306fa8a8 /omfwd.c
parent7fc7824b866ef7657ba52e8d7bc806d981d73811 (diff)
downloadrsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.tar.gz
rsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.tar.xz
rsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.zip
- simplified code in shouldProcessThisMessage() for debug output
- changed strerror() calls to thread-safe strerror_r() variant
Diffstat (limited to 'omfwd.c')
-rw-r--r--omfwd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/omfwd.c b/omfwd.c
index b7a7b025..07ff7ac2 100644
--- a/omfwd.c
+++ b/omfwd.c
@@ -232,8 +232,9 @@ static int TCPSendCreateSocket(instanceData *pData, struct addrinfo *addrDest)
TCPSendSetStatus(pData, TCP_SEND_CONNECTING);
return fd;
} else {
+ char errStr[1024];
dbgprintf("create tcp connection failed, reason %s",
- strerror(errno));
+ strerror_r(errno, errStr, sizeof(errStr)));
}
}
@@ -244,7 +245,8 @@ static int TCPSendCreateSocket(instanceData *pData, struct addrinfo *addrDest)
close(fd);
}
else {
- dbgprintf("couldn't create send socket, reason %s", strerror(errno));
+ char errStr[1024];
+ dbgprintf("couldn't create send socket, reason %s", strerror_r(errno, errStr, sizeof(errStr)));
}
r = r->ai_next;
}
@@ -682,8 +684,9 @@ CODESTARTdoAction
break;
} else {
int eno = errno;
+ char errStr[1024];
dbgprintf("sendto() error: %d = %s.\n",
- eno, strerror(eno));
+ eno, strerror_r(eno, errStr, sizeof(errStr)));
}
}
if (lsent == l && !send_to_all)