(tried to) fix logerror() call under BSD (but can not yet compile, so this

may be an error...)
This commit is contained in:
Rainer Gerhards 2008-03-06 09:59:35 +00:00
parent 08b2347039
commit 24fd07ebe6
4 changed files with 10 additions and 4 deletions

View File

@ -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];

4
net.c
View File

@ -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;
}

View File

@ -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
/*

View File

@ -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 */