summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--errmsg.c2
-rw-r--r--net.c4
-rw-r--r--omusrmsg.c5
-rw-r--r--plugins/imfile/imfile.c3
4 files changed, 10 insertions, 4 deletions
diff --git a/errmsg.c b/errmsg.c
index 43593a75..907046b9 100644
--- a/errmsg.c
+++ b/errmsg.c
@@ -49,7 +49,7 @@ DEFobjStaticHelpers
* to check errno and, if so, how to do that in a clean way.
*/
static void __attribute__((format(printf, 2, 3)))
-LogError(int iErrCode, char *fmt, ... )
+LogError(int __attribute__((unused)) iErrCode, char *fmt, ... )
{
va_list ap;
char buf[1024];
diff --git a/net.c b/net.c
index 43c30b53..103d975c 100644
--- a/net.c
+++ b/net.c
@@ -195,7 +195,7 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS
switch (iAllow->addr.NetAddr->sa_family) {
case AF_INET:
if((iSignificantBits < 1) || (iSignificantBits > 32)) {
- errmsg.LogError(NO_ERRCODE, "Invalid bit number in IPv4 address - adjusted to 32",
+ errmsg.LogError(NO_ERRCODE, "Invalid number of bits (%d) in IPv4 address - adjusted to 32",
(int)iSignificantBits);
iSignificantBits = 32;
}
@@ -204,7 +204,7 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS
break;
case AF_INET6:
if((iSignificantBits < 1) || (iSignificantBits > 128)) {
- errmsg.LogError(NO_ERRCODE, "Invalid bit number in IPv6 address - adjusted to 128",
+ errmsg.LogError(NO_ERRCODE, "Invalid number of bits (%d) in IPv6 address - adjusted to 128",
iSignificantBits);
iSignificantBits = 128;
}
diff --git a/omusrmsg.c b/omusrmsg.c
index 382f6158..b8d212ac 100644
--- a/omusrmsg.c
+++ b/omusrmsg.c
@@ -58,6 +58,7 @@
#include "syslogd.h"
#include "omusrmsg.h"
#include "module-template.h"
+#include "errmsg.h"
/* portability: */
@@ -71,6 +72,7 @@ MODULE_TYPE_OUTPUT
/* internal structures
*/
DEF_OMOD_STATIC_DATA
+DEFobjCurrIf(errmsg)
typedef struct _instanceData {
int bIsWall; /* 1- is wall, 0 - individual users */
@@ -128,7 +130,7 @@ void setutent(void)
{
assert(BSD_uf == NULL);
if ((BSD_uf = fopen(_PATH_UTMP, "r")) == NULL) {
- logerror(_PATH_UTMP);
+ errmsg.LogError(NO_ERRNO, "%s", _PATH_UTMP);
return;
}
}
@@ -347,6 +349,7 @@ BEGINmodInit(UsrMsg)
CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
ENDmodInit
/*
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index 243004ab..c65fc436 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -32,6 +32,9 @@
#include <errno.h>
#include <fcntl.h>
#include <pthread.h> /* do NOT remove: will soon be done by the module generation macros */
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#include "rsyslog.h" /* error codes etc... */
#include "syslogd.h"
#include "cfsysline.h" /* access to config file objects */