summaryrefslogtreecommitdiffstats
path: root/cfsysline.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:28:33 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:28:33 +0000
commitf547af1f86b489faaf16b4a040df5ebd3c974af5 (patch)
treed9607b3f23b8745ce72f22ec1e51e22e5e4e3afc /cfsysline.c
parent4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7 (diff)
downloadrsyslog-f547af1f86b489faaf16b4a040df5ebd3c974af5.tar.gz
rsyslog-f547af1f86b489faaf16b4a040df5ebd3c974af5.tar.xz
rsyslog-f547af1f86b489faaf16b4a040df5ebd3c974af5.zip
finally implemented infinite action retries via -1 retry count
Diffstat (limited to 'cfsysline.c')
-rw-r--r--cfsysline.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cfsysline.c b/cfsysline.c
index 50d0066b..c87c2a54 100644
--- a/cfsysline.c
+++ b/cfsysline.c
@@ -103,9 +103,10 @@ finalize_it:
*/
static rsRetVal parseIntVal(uchar **pp, size_t *pVal)
{
- uchar *p;
DEFiRet;
+ uchar *p;
size_t i;
+ int bWasNegative;
assert(pp != NULL);
assert(*pp != NULL);
@@ -114,6 +115,13 @@ static rsRetVal parseIntVal(uchar **pp, size_t *pVal)
skipWhiteSpace(pp); /* skip over any whitespace */
p = *pp;
+ if(*p == '-') {
+ bWasNegative = 1;
+ ++p; /* eat it */
+ } else {
+ bWasNegative = 0;
+ }
+
if(!isdigit((int) *p)) {
errno = 0;
logerror("invalid number");
@@ -124,6 +132,9 @@ static rsRetVal parseIntVal(uchar **pp, size_t *pVal)
for(i = 0 ; *p && isdigit((int) *p) ; ++p)
i = i * 10 + *p - '0';
+ if(bWasNegative)
+ i *= -1;
+
*pVal = i;
*pp = p;