diff options
-rw-r--r-- | errmsg.c | 2 | ||||
-rw-r--r-- | net.c | 4 | ||||
-rw-r--r-- | omusrmsg.c | 5 | ||||
-rw-r--r-- | plugins/imfile/imfile.c | 3 |
4 files changed, 10 insertions, 4 deletions
@@ -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]; @@ -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; } @@ -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 */ |