summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-07-06 00:13:29 +0200
committerMichael Biebl <biebl@debian.org>2013-07-06 00:13:29 +0200
commitf5638ea86a8626b7e0e471d720359cb4e3d8cb1c (patch)
treefd1fffc1917bd10431c829e0a439c2a522ffda6d /runtime
parentc62e2e3b0f562a4ce54f7edcbb76400d90118717 (diff)
downloadrsyslog-f5638ea86a8626b7e0e471d720359cb4e3d8cb1c.tar.gz
Imported Upstream version 7.4.2upstream/7.4.2
Diffstat (limited to 'runtime')
-rw-r--r--runtime/lmsig_gt.c10
-rw-r--r--runtime/msg.c30
-rw-r--r--runtime/net.c1
-rw-r--r--runtime/stream.c1
-rw-r--r--runtime/strmsrv.h2
-rw-r--r--runtime/typedefs.h13
6 files changed, 49 insertions, 8 deletions
diff --git a/runtime/lmsig_gt.c b/runtime/lmsig_gt.c
index e9194c7..116a48d 100644
--- a/runtime/lmsig_gt.c
+++ b/runtime/lmsig_gt.c
@@ -89,7 +89,11 @@ SetCnfParam(void *pT, struct nvlst *lst)
int i;
uchar *cstr;
struct cnfparamvals *pvals;
+ DEFiRet;
pvals = nvlstGetParams(lst, &pblk, NULL);
+ if(pvals == NULL) {
+ ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS);
+ }
if(Debug) {
dbgprintf("sig param blk in lmsig_gt:\n");
cnfparamsPrint(&pblk, pvals);
@@ -120,8 +124,10 @@ SetCnfParam(void *pT, struct nvlst *lst)
"param '%s'\n", pblk.descr[i].name);
}
}
- cnfparamvalsDestruct(pvals, &pblk);
- return RS_RET_OK;
+finalize_it:
+ if(pvals != NULL)
+ cnfparamvalsDestruct(pvals, &pblk);
+ RETiRet;
}
diff --git a/runtime/msg.c b/runtime/msg.c
index a5c5281..9d5fa88 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2989,15 +2989,39 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
break;
case PROP_SYS_UPTIME:
# ifndef HAVE_SYSINFO_UPTIME
- /* An alternative on some systems (eg Solaris) is to scan
- * /var/adm/utmpx for last boot time.
- */
+ /* An alternative on some systems (eg Solaris) is to scan
+ * /var/adm/utmpx for last boot time.
+ */
pRes = (uchar*) "UPTIME NOT available on this system";
*pbMustBeFreed = 0;
+
+# elif defined(__FreeBSD__)
+
+ {
+ struct timespec tp;
+
+ if(*pbMustBeFreed == 1)
+ free(pRes);
+ if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) {
+ RET_OUT_OF_MEMORY;
+ }
+ *pbMustBeFreed = 1;
+
+ if(clock_gettime(CLOCK_UPTIME, &tp) == -1) {
+ *pPropLen = sizeof("**SYSCALL FAILED**") - 1;
+ return(UCHAR_CONSTANT("**SYSCALL FAILED**"));
+ }
+
+ snprintf((char*) pRes, sizeof(uchar) * 32, "%ld", tp.tv_sec);
+ }
+
# else
+
{
struct sysinfo s_info;
+ if(*pbMustBeFreed == 1)
+ free(pRes);
if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) {
RET_OUT_OF_MEMORY;
}
diff --git a/runtime/net.c b/runtime/net.c
index b291213..13391cc 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -232,6 +232,7 @@ finalize_it:
/* enqueue the element */
if(pPeer->pWildcardRoot == NULL) {
pPeer->pWildcardRoot = pNew;
+ pPeer->pWildcardLast = pNew;
} else {
pPeer->pWildcardLast->pNext = pNew;
}
diff --git a/runtime/stream.c b/runtime/stream.c
index b781324..54210e4 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -67,7 +67,6 @@
# define O_LARGEFILE 0
#endif
#ifndef HAVE_LSEEK64
- typedef off_t off64_t;
# define lseek64(fd, offset, whence) lseek(fd, offset, whence)
#endif
diff --git a/runtime/strmsrv.h b/runtime/strmsrv.h
index 9ef28e4..f3d56d1 100644
--- a/runtime/strmsrv.h
+++ b/runtime/strmsrv.h
@@ -43,7 +43,7 @@ struct strmsrv_s {
uchar *pszInputName; /**< value to be used as input name */
permittedPeers_t *pPermPeers;/**< driver's permitted peers */
int iLstnMax; /**< max nbr of listeners currently supported */
- netstrm_t **ppLstn; /**< our netstream listners */
+ netstrm_t **ppLstn; /**< our netstream listeners */
strmLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */
int iSessMax; /**< max number of sessions supported */
strmLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */
diff --git a/runtime/typedefs.h b/runtime/typedefs.h
index 5cc24e4..d3f68b4 100644
--- a/runtime/typedefs.h
+++ b/runtime/typedefs.h
@@ -3,7 +3,7 @@
*
* Begun 2010-11-25 RGerhards
*
- * Copyright (C) 2005-2008 by Rainer Gerhards and Adiscon GmbH
+ * Copyright (C) 2005-2013 by Rainer Gerhards and Adiscon GmbH
*
* This file is part of the rsyslog runtime library.
*
@@ -25,6 +25,13 @@
*/
#ifndef INCLUDED_TYPEDEFS_H
#define INCLUDED_TYPEDEFS_H
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#endif
+
+#ifndef HAVE_LSEEK64
+#include <unistd.h>
+#endif
/* some universal fixed size integer defines ... */
typedef long long int64;
@@ -148,6 +155,10 @@ typedef enum {
FIOP_ISEMPTY = 6 /* string empty <=> strlen(s) == 0 ?*/
} fiop_t;
+#ifndef HAVE_LSEEK64
+ typedef off_t off64_t;
+#endif
+
/* types of configuration handlers
*/
typedef enum cslCmdHdlrType {