mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 02:10:42 +01:00
(tried to) fix logerror() call under BSD (but can not yet compile, so this
may be an error...)
This commit is contained in:
parent
08b2347039
commit
24fd07ebe6
2
errmsg.c
2
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];
|
||||
|
||||
4
net.c
4
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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
/*
|
||||
|
||||
@ -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 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user