summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-06-04 22:22:46 +0200
committerMichael Biebl <biebl@debian.org>2014-06-04 22:22:46 +0200
commitdaeb0d03d4a65fa118ad25b34958fb9cacbbd6f4 (patch)
tree0c0d778c5d2f16d8dcc04e89b44a75e02769fa67 /runtime
parentf1040389ccb2430b9ab2ba3209aa28a62565b721 (diff)
downloadrsyslog-daeb0d03d4a65fa118ad25b34958fb9cacbbd6f4.tar.gz
Imported Upstream version 8.2.2upstream/8.2.2
Diffstat (limited to 'runtime')
-rw-r--r--runtime/libgcry.c8
-rw-r--r--runtime/module-template.h30
-rw-r--r--runtime/net.c6
-rw-r--r--runtime/nspoll.c34
-rw-r--r--runtime/nspoll.h28
-rw-r--r--runtime/nssel.c3
-rw-r--r--runtime/queue.c2
-rw-r--r--runtime/ratelimit.c2
-rw-r--r--runtime/stream.c10
9 files changed, 61 insertions, 62 deletions
diff --git a/runtime/libgcry.c b/runtime/libgcry.c
index 4772cf4..9dabf5f 100644
--- a/runtime/libgcry.c
+++ b/runtime/libgcry.c
@@ -154,7 +154,7 @@ eiCheckFiletype(gcryfile gf)
close(gf->fd);
gf->fd = -1;
}
- DBGPRINTF("eiCheckFiletype read %d bytes: '%s'\n", didRead, hdrBuf);
+ DBGPRINTF("eiCheckFiletype read %zd bytes: '%s'\n", didRead, hdrBuf);
if( didRead != toRead
|| strncmp(hdrBuf, "FILETYPE:" RSGCRY_FILETYPE_NAME "\n", toRead))
iRet = RS_RET_EI_INVLD_FILE;
@@ -213,7 +213,7 @@ eiGetIV(gcryfile gf, uchar *iv, size_t leniv)
}
valueLen = strlen(value);
if(valueLen/2 != leniv) {
- DBGPRINTF("length of IV is %d, expected %d\n",
+ DBGPRINTF("length of IV is %zd, expected %zd\n",
valueLen/2, leniv);
ABORT_FINALIZE(RS_RET_ERR);
}
@@ -322,7 +322,7 @@ eiClose(gcryfile gf, off64_t offsLogfile)
return;
if(gf->openMode == 'w') {
/* 2^64 is 20 digits, so the snprintf buffer is large enough */
- len = snprintf(offs, sizeof(offs), "%lld", offsLogfile);
+ len = snprintf(offs, sizeof(offs), "%lld", (long long) offsLogfile);
eiWriteRec(gf, "END:", 4, offs, len);
}
gcry_cipher_close(gf->chd);
@@ -429,7 +429,7 @@ addPadding(gcryfile pF, uchar *buf, size_t *plen)
unsigned i;
size_t nPad;
nPad = (pF->blkLength - *plen % pF->blkLength) % pF->blkLength;
- DBGPRINTF("libgcry: addPadding %d chars, blkLength %d, mod %d, pad %d\n",
+ DBGPRINTF("libgcry: addPadding %zd chars, blkLength %zd, mod %zd, pad %zd\n",
*plen, pF->blkLength, *plen % pF->blkLength, nPad);
for(i = 0 ; i < nPad ; ++i)
buf[(*plen)+i] = 0x00;
diff --git a/runtime/module-template.h b/runtime/module-template.h
index 19b0ca3..95c35b4 100644
--- a/runtime/module-template.h
+++ b/runtime/module-template.h
@@ -4,25 +4,23 @@
*
* File begun on 2007-07-25 by RGerhards
*
- * Copyright 2007-2012 Adiscon GmbH. This is Adiscon-exclusive code without any other
- * contributions. *** GPLv3 ***
+ * Copyright 2007-2012 Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Rsyslog is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * -or-
+ * see COPYING.ASL20 in the source distribution
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#ifndef MODULE_TEMPLATE_H_INCLUDED
#define MODULE_TEMPLATE_H_INCLUDED 1
diff --git a/runtime/net.c b/runtime/net.c
index 7c180b1..4d272f1 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -1318,14 +1318,14 @@ int *create_udp_socket(uchar *hostname, uchar *pszPort, int bIsServer, int rcvbu
if(Debug || rcvbuf != 0) {
optlen = sizeof(actrcvbuf);
if(getsockopt(*s, SOL_SOCKET, SO_RCVBUF, &actrcvbuf, &optlen) == 0) {
- dbgprintf("socket %d, actual rcvbuf size %d\n", *s, actrcvbuf);
+ dbgprintf("socket %d, actual os socket rcvbuf size %d\n", *s, actrcvbuf);
if(rcvbuf != 0 && actrcvbuf/2 != rcvbuf) {
errmsg.LogError(errno, NO_ERRCODE,
- "cannot set rcvbuf size %d for socket %d, value now is %d",
+ "cannot set os socket rcvbuf size %d for socket %d, value now is %d",
rcvbuf, *s, actrcvbuf/2);
}
} else {
- dbgprintf("could not obtain rcvbuf size for socket %d: %s\n",
+ dbgprintf("could not obtain os socket rcvbuf size for socket %d: %s\n",
*s, rs_strerror_r(errno, errStr, sizeof(errStr)));
}
}
diff --git a/runtime/nspoll.c b/runtime/nspoll.c
index 43631f4..94fba03 100644
--- a/runtime/nspoll.c
+++ b/runtime/nspoll.c
@@ -6,25 +6,21 @@
*
* Work on this module begun 2009-11-18 by Rainer Gerhards.
*
- * Copyright 2009 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2009-2014 Rainer Gerhards and Adiscon GmbH.
*
- * This file is part of the rsyslog runtime library.
- *
- * The rsyslog runtime library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The rsyslog runtime library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
- * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * -or-
+ * see COPYING.ASL20 in the source distribution
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#include "config.h"
@@ -66,6 +62,7 @@ loadDrvr(nspoll_t *pThis)
uchar szDrvrName[48]; /* 48 shall be large enough */
pBaseDrvrName = pThis->pBaseDrvrName;
+ if(pBaseDrvrName == NULL) /* if no drvr name is set, use system default */
pBaseDrvrName = glbl.GetDfltNetstrmDrvr();
if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmnsdpoll_%s", pBaseDrvrName) == sizeof(szDrvrName))
ABORT_FINALIZE(RS_RET_DRVRNAME_TOO_LONG);
@@ -105,6 +102,7 @@ CODESTARTobjDestruct(nspoll)
* a driver name string as load indicator (because we also need that string
* to release the driver
*/
+ free(pThis->pBaseDrvrName);
if(pThis->pDrvrName != NULL) {
obj.ReleaseObj(__FILE__, pThis->pDrvrName+2, DONT_LOAD_LIB, (void*) &pThis->Drvr);
free(pThis->pDrvrName);
diff --git a/runtime/nspoll.h b/runtime/nspoll.h
index 3a6e060..a9e9eb0 100644
--- a/runtime/nspoll.h
+++ b/runtime/nspoll.h
@@ -4,21 +4,19 @@
*
* This file is part of the rsyslog runtime library.
*
- * The rsyslog runtime library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The rsyslog runtime library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
- * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * -or-
+ * see COPYING.ASL20 in the source distribution
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#ifndef INCLUDED_NSPOLL_H
diff --git a/runtime/nssel.c b/runtime/nssel.c
index 6ca0f26..533d92b 100644
--- a/runtime/nssel.c
+++ b/runtime/nssel.c
@@ -9,7 +9,7 @@
*
* Work on this module begun 2008-04-22 by Rainer Gerhards.
*
- * Copyright 2008-2012 Adiscon GmbH.
+ * Copyright 2008-2014 Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@@ -107,6 +107,7 @@ CODESTARTobjDestruct(nssel)
* a driver name string as load indicator (because we also need that string
* to release the driver
*/
+ free(pThis->pBaseDrvrName);
if(pThis->pDrvrName != NULL) {
obj.ReleaseObj(__FILE__, pThis->pDrvrName+2, DONT_LOAD_LIB, (void*) &pThis->Drvr);
free(pThis->pDrvrName);
diff --git a/runtime/queue.c b/runtime/queue.c
index 4664010..e1d46d5 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1479,7 +1479,7 @@ DoDeleteBatchFromQStore(qqueue_t *pThis, int nElem)
if(bytesDel != 0) {
pThis->tVars.disk.sizeOnDisk -= bytesDel;
DBGOPRINT((obj_t*) pThis, "doDeleteBatch: a %lld octet file has been deleted, now %lld octets disk "
- "space used\n", bytesDel, pThis->tVars.disk.sizeOnDisk);
+ "space used\n", (long long) bytesDel, pThis->tVars.disk.sizeOnDisk);
/* awake possibly waiting enq process */
pthread_cond_signal(&pThis->notFull); /* we hold the mutex while we are in here! */
}
diff --git a/runtime/ratelimit.c b/runtime/ratelimit.c
index 016fd3c..22e9375 100644
--- a/runtime/ratelimit.c
+++ b/runtime/ratelimit.c
@@ -301,6 +301,8 @@ ratelimitNew(ratelimit_t **ppThis, char *modname, char *dynname)
}
/* pThis->severity == 0 - all messages are ratelimited */
pThis->bReduceRepeatMsgs = loadConf->globals.bReduceRepeatMsgs;
+ DBGPRINTF("ratelimit:%s:new ratelimiter:bReduceRepeatMsgs %d\n",
+ pThis->name, pThis->bReduceRepeatMsgs);
*ppThis = pThis;
finalize_it:
RETiRet;
diff --git a/runtime/stream.c b/runtime/stream.c
index 223ee93..1bf1c47 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -301,9 +301,11 @@ CheckFileChange(strm_t *pThis)
if(stat((char*) pThis->pszCurrFName, &statName) == -1)
ABORT_FINALIZE(RS_RET_IO_ERROR);
DBGPRINTF("stream/after deserialize checking for file change on '%s', "
- "inode %u/%u, size/currOffs %llu/%llu\n",
- pThis->pszCurrFName, (unsigned) pThis->inode,
- (unsigned) statName.st_ino, statName.st_size, pThis->iCurrOffs);
+ "inode %u/%u, size/currOffs %llu/%llu\n",
+ pThis->pszCurrFName, (unsigned) pThis->inode,
+ (unsigned) statName.st_ino,
+ (long long unsigned) statName.st_size,
+ (long long unsigned) pThis->iCurrOffs);
if(pThis->inode != statName.st_ino || statName.st_size < pThis->iCurrOffs) {
DBGPRINTF("stream: file %s has changed\n", pThis->pszCurrFName);
pThis->iCurrOffs = 0;
@@ -1460,7 +1462,7 @@ static rsRetVal strmSeek(strm_t *pThis, off64_t offs)
DBGOPRINT((obj_t*) pThis, "file %d seek, pos %llu\n", pThis->fd, (long long unsigned) offs);
i = lseek64(pThis->fd, offs, SEEK_SET);
if(i != offs) {
- DBGPRINTF("strmSeek: error %lld seeking to offset %lld\n", i, offs);
+ DBGPRINTF("strmSeek: error %lld seeking to offset %lld\n", i, (long long) offs);
ABORT_FINALIZE(RS_RET_IO_ERROR);
}
pThis->iCurrOffs = offs; /* we are now at *this* offset */