diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | plugins/impstats/impstats.c | 4 | ||||
-rw-r--r-- | runtime/msg.c | 30 | ||||
-rw-r--r-- | runtime/typedefs.h | 6 |
4 files changed, 44 insertions, 5 deletions
@@ -1,4 +1,3 @@ ---------------------------------------------------------------------------- Version 7.5.1 [devel] 2013-06-?? - add mmfields, which among others supports easy parsing of CEF messages - omrelp: @@ -19,6 +18,7 @@ Version 7.5.1 [devel] 2013-06-?? * "bsd_security" - this is called "security" under BSD, but that name was unfortunately already taken by some standard facility. So I did the (hopefully) second-best thing and renamed it a little. +- imported fixes from 7.4.2 (especially build problems on FreeBSD) --------------------------------------------------------------------------- Version 7.5.0 [devel] 2013-06-11 - imrelp: implement "ruleset" module parameter @@ -28,6 +28,13 @@ Version 7.5.0 [devel] 2013-06-11 connections Thanks to Axel Rau for the patch. --------------------------------------------------------------------------- +Version 7.4.2 [v7.4-stable] 2013-06-?? +- bugfix: small memory leak when $uptime property was used +- solved build problems on FreeBSD + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=457 + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=458 + Thanks to Christiano for reproting and suggesting patches +--------------------------------------------------------------------------- Version 7.4.1 [v7.4-stable] 2013-06-17 - imjournal: add ratelimiting capability The original imjournal code did not support ratelimiting at all. We diff --git a/plugins/impstats/impstats.c b/plugins/impstats/impstats.c index cdd205fd..79749e21 100644 --- a/plugins/impstats/impstats.c +++ b/plugins/impstats/impstats.c @@ -29,6 +29,10 @@ #include <pthread.h> #include <fcntl.h> #include <sys/uio.h> +#if defined(__FreeBSD__) +#include <sys/stat.h> +#endif + #include "dirty.h" #include "cfsysline.h" #include "module-template.h" diff --git a/runtime/msg.c b/runtime/msg.c index a5c52810..8c50b7b3 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; + +# elseif 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/typedefs.h b/runtime/typedefs.h index 5cc24e4a..ca63d0d5 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. * @@ -148,6 +148,10 @@ typedef enum { FIOP_ISEMPTY = 6 /* string empty <=> strlen(s) == 0 ?*/ } fiop_t; +#if defined(__FreeBSD__) + typedef off_t off64_t; +#endif + /* types of configuration handlers */ typedef enum cslCmdHdlrType { |