diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-07 14:58:58 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-07 14:58:58 +0200 |
commit | 829385ce407433af0f7679eedb09357ad4055f2e (patch) | |
tree | 62e9576f42154c5ed29eb3a6c868a08e066e9f6f /runtime | |
parent | 010060289a729dd930ac04b72237f0ca0db9ea1d (diff) | |
parent | 0550512b28049c391be424ad518ed0debb77089e (diff) | |
download | rsyslog-829385ce407433af0f7679eedb09357ad4055f2e.tar.gz rsyslog-829385ce407433af0f7679eedb09357ad4055f2e.tar.xz rsyslog-829385ce407433af0f7679eedb09357ad4055f2e.zip |
Merge branch 'beta'
Conflicts:
ChangeLog
configure.ac
doc/manual.html
doc/rsyslog_conf.html
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/stringbuf.c | 2 | ||||
-rw-r--r-- | runtime/var.c | 4 | ||||
-rw-r--r-- | runtime/wtp.c | 8 |
3 files changed, 11 insertions, 3 deletions
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c index 35ec44c6..07256fab 100644 --- a/runtime/stringbuf.c +++ b/runtime/stringbuf.c @@ -850,7 +850,7 @@ rsCStrConvertToNumber(cstr_t *pStr, number_t *pNumber) /* TODO: octal? hex? */ n = 0; while(i < pStr->iStrLen && isdigit(pStr->pBuf[i])) { - n = n * 10 + pStr->pBuf[i] * 10; + n = n * 10 + pStr->pBuf[i] - '0'; ++i; } diff --git a/runtime/var.c b/runtime/var.c index 559bc56c..ef7cc8e6 100644 --- a/runtime/var.c +++ b/runtime/var.c @@ -366,7 +366,7 @@ ConvForOperation(var_t *pThis, var_t *pOther) case VARTYPE_NUMBER: /* check if we can convert pThis to a number, if so use number format. */ iRet = ConvToNumber(pThis); - if(iRet != RS_RET_NOT_A_NUMBER) { + if(iRet == RS_RET_NOT_A_NUMBER) { CHKiRet(ConvToString(pOther)); } else { FINALIZE; /* OK or error */ @@ -384,7 +384,7 @@ ConvForOperation(var_t *pThis, var_t *pOther) break; case VARTYPE_STR: iRet = ConvToNumber(pOther); - if(iRet != RS_RET_NOT_A_NUMBER) { + if(iRet == RS_RET_NOT_A_NUMBER) { CHKiRet(ConvToString(pThis)); } else { FINALIZE; /* OK or error */ diff --git a/runtime/wtp.c b/runtime/wtp.c index 9f54a9ab..04eb974f 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -206,6 +206,14 @@ wtpProcessThrdChanges(wtp_t *pThis) FINALIZE; } + /* Note: there is a left-over potential race condition below: + * pThis->bThrdStateChanged may be re-set by another thread while + * we work on it and thus the loop may terminate too early. However, + * there are no really bad effects from that so I perfer - for this + * version - to live with the problem as is. Not a good idea to + * introduce that large change into the stable branch without very + * good reason. -- rgerhards, 2009-04-02 + */ do { /* reset the change marker */ pThis->bThrdStateChanged = 0; |