mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-16 23:50:41 +01:00
AIX_port: corrects style and compatibility issues (3)
This commit is contained in:
parent
4dd23cffc1
commit
11c6365eba
@ -26,24 +26,24 @@
|
||||
#include <stdio.h>
|
||||
int asprintf(char **strp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int len;
|
||||
va_list ap;
|
||||
int len;
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
*strp = malloc(len+1);
|
||||
if (!*strp) {
|
||||
return -1;
|
||||
}
|
||||
*strp = malloc(len+1);
|
||||
if (!*strp) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(*strp, len+1, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(*strp, len+1, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
(*strp)[len] = 0;
|
||||
return len;
|
||||
(*strp)[len] = 0;
|
||||
return len;
|
||||
}
|
||||
#else
|
||||
/* XLC needs at least one method in source file even static to compile */
|
||||
|
||||
@ -335,9 +335,10 @@ static rsRetVal pollFile(instanceConf_t *pInst)
|
||||
if (fixedModConf.buffer_minsize[msg_len-1] == ']')
|
||||
{ /* We read the last part of the report to get structured data */
|
||||
|
||||
for (structured_data = fixedModConf.buffer_minsize + msg_len, structured_data_len = 0;
|
||||
structured_data >= fixedModConf.buffer_minsize && *structured_data != '[';
|
||||
structured_data--, structured_data_len++)
|
||||
for (structured_data = fixedModConf.buffer_minsize + msg_len,
|
||||
structured_data_len = 0;
|
||||
structured_data >= fixedModConf.buffer_minsize && *structured_data != '[';
|
||||
structured_data--, structured_data_len++)
|
||||
;
|
||||
|
||||
if (*structured_data == '[')
|
||||
@ -346,7 +347,8 @@ static rsRetVal pollFile(instanceConf_t *pInst)
|
||||
if (struct_field)
|
||||
{
|
||||
start_ts = 0;
|
||||
for (struct_field += 7; (v = *struct_field - (uchar)'0') <= 9; struct_field++ )
|
||||
for (struct_field += 7; (v = *struct_field - (uchar)'0') <= 9;
|
||||
struct_field++ )
|
||||
start_ts = start_ts*10 + v;
|
||||
|
||||
}
|
||||
|
||||
@ -84,9 +84,10 @@ typedef struct {
|
||||
time_t return_check_interval; /* time interval between usual server health checks */
|
||||
time_t half_return_check_interval; /* for computing */
|
||||
time_t quick_oscillation_interval; /* time interval below which the service is not stable */
|
||||
int quick_oscillation_max; /* number of quick oscillation after which the connection is kept on backup */
|
||||
time_t graceful_interval; /* time interval the connection is kept on backup after which the usual server check restarts */
|
||||
int quick_oscillation_count; /* current number of simultaneous quick oscillation detected */
|
||||
int quick_oscillation_max; /* number of quick oscillation after which the connection is kept on backup */
|
||||
time_t graceful_interval; /* time interval the connection is kept on backup after which the usual server
|
||||
* check restarts */
|
||||
int quick_oscillation_count; /* current number of simultaneous quick oscillation detected */
|
||||
} failback_t;
|
||||
|
||||
typedef struct _instanceData {
|
||||
@ -208,7 +209,8 @@ static void init_failback(failback_t *fb, char *str)
|
||||
fb->half_return_check_interval = fb->return_check_interval / 2;
|
||||
fb->quick_oscillation_interval = (value[1]) ? value[1] : (fb->return_check_interval / 10);
|
||||
fb->quick_oscillation_max = (value[2]) ? (int)(value[2]) : 3;
|
||||
fb->graceful_interval = (value[3]) ? value[3] : (fb->return_check_interval * 60) - fb->half_return_check_interval;
|
||||
fb->graceful_interval = (value[3]) ? value[3] : (fb->return_check_interval * 60) -
|
||||
fb->half_return_check_interval;
|
||||
fb->quick_oscillation_count = 0;
|
||||
}
|
||||
|
||||
@ -381,8 +383,10 @@ static void* run_connection_routine(void* arg)
|
||||
|
||||
result = amqp_simple_wait_frame_noblock(self->a_conn, &frame, &delay);
|
||||
|
||||
/* if connected to rescue server then check if usual server is alive. if so then disconnect from rescue */
|
||||
if (result == AMQP_STATUS_TIMEOUT && (new_conn = tryConnection(self, &(self->serverPrefered.s))) != NULL) {
|
||||
/* if connected to rescue server then check if usual server is alive. if so
|
||||
* then disconnect from rescue */
|
||||
if (result == AMQP_STATUS_TIMEOUT &&
|
||||
(new_conn = tryConnection(self, &(self->serverPrefered.s))) != NULL) {
|
||||
amqp_connection_state_t old_conn = self->a_conn;
|
||||
d_pthread_mutex_lock(&self->send_mutex);
|
||||
self->a_conn = new_conn;
|
||||
@ -407,21 +411,25 @@ static void* run_connection_routine(void* arg)
|
||||
case AMQP_STATUS_TIMEOUT:
|
||||
break;
|
||||
case AMQP_STATUS_NO_MEMORY:
|
||||
LogError(0, RS_RET_OUT_OF_MEMORY, "omrabbitmq module %d/%d: no memory : aborting module.", self->iidx, self->widx);
|
||||
LogError(0, RS_RET_OUT_OF_MEMORY, "omrabbitmq module %d/%d: no memory : aborting module.",
|
||||
self->iidx, self->widx);
|
||||
go_on = 0; /* non recoverable error let's go out */
|
||||
connected = 0;
|
||||
state_out = RS_RET_DISABLE_ACTION;
|
||||
break;
|
||||
case AMQP_STATUS_BAD_AMQP_DATA:
|
||||
LogError(0, RS_RET_RABBITMQ_CONN_ERR, "omrabbitmq module %d/%d: bad data received : reconnect.", self->iidx, self->widx);
|
||||
LogError(0, RS_RET_RABBITMQ_CONN_ERR, "omrabbitmq module %d/%d: bad data received : "
|
||||
"reconnect.", self->iidx, self->widx);
|
||||
connected = 0;
|
||||
break;
|
||||
case AMQP_STATUS_SOCKET_ERROR:
|
||||
LogError(0, RS_RET_RABBITMQ_CONN_ERR, "omrabbitmq module %d/%d: Socket error : reconnect.", self->iidx, self->widx);
|
||||
LogError(0, RS_RET_RABBITMQ_CONN_ERR, "omrabbitmq module %d/%d: Socket error : reconnect.",
|
||||
self->iidx, self->widx);
|
||||
connected = 0;
|
||||
break;
|
||||
case AMQP_STATUS_CONNECTION_CLOSED:
|
||||
LogError(0, RS_RET_OUT_OF_MEMORY, "omrabbitmq module %d/%d: Connection closed : reconnect.", self->iidx, self->widx);
|
||||
LogError(0, RS_RET_OUT_OF_MEMORY, "omrabbitmq module %d/%d: Connection closed : reconnect.",
|
||||
self->iidx, self->widx);
|
||||
connected = 0;
|
||||
break;
|
||||
case AMQP_STATUS_OK:
|
||||
@ -436,7 +444,8 @@ static void* run_connection_routine(void* arg)
|
||||
go_on = 0;
|
||||
break;
|
||||
case AMQP_CHANNEL_CLOSE_METHOD:
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: Close Channel Received (%X).", self->iidx, self->widx, frame.payload.method.id);
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: Close Channel Received (%X).",
|
||||
self->iidx, self->widx, frame.payload.method.id);
|
||||
{
|
||||
amqp_channel_close_ok_t req;
|
||||
req.dummy = '\0';
|
||||
@ -445,7 +454,8 @@ static void* run_connection_routine(void* arg)
|
||||
}
|
||||
break;
|
||||
case AMQP_CONNECTION_CLOSE_METHOD:
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: Close Connection Received (%X).", self->iidx, self->widx, frame.payload.method.id);
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: Close Connection "
|
||||
"Received (%X).", self->iidx, self->widx, frame.payload.method.id);
|
||||
{
|
||||
amqp_connection_close_ok_t req;
|
||||
req.dummy = '\0';
|
||||
@ -455,7 +465,8 @@ static void* run_connection_routine(void* arg)
|
||||
connected = 0;
|
||||
break;
|
||||
default :
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: unmanaged amqp method received (%X) : ignored.", self->iidx, self->widx, frame.payload.method.id);
|
||||
LogMsg(0, RS_RET_OK, LOG_WARNING, "omrabbitmq module %d/%d: unmanaged amqp method"
|
||||
" received (%X) : ignored.", self->iidx, self->widx, frame.payload.method.id);
|
||||
} /* switch (frame.payload.method.id) */
|
||||
}
|
||||
break;
|
||||
@ -741,7 +752,8 @@ CODESTARTdbgPrintInstInfo
|
||||
dbgprintf("\t\tusual server check interval=%ld s", pData->failback_policy.return_check_interval);
|
||||
dbgprintf("\t\tquick oscillation limit=%ld s", pData->failback_policy.quick_oscillation_interval);
|
||||
dbgprintf("\t\tmax number of oscillation=%d s", pData->failback_policy.quick_oscillation_max);
|
||||
dbgprintf("\t\tgraceful interval after quick oscillation detection=%ld s", pData->failback_policy.graceful_interval);
|
||||
dbgprintf("\t\tgraceful interval after quick oscillation detection=%ld s",
|
||||
pData->failback_policy.graceful_interval);
|
||||
}else{
|
||||
dbgprintf("\thost='%s' \n", pData->server1.host);
|
||||
dbgprintf("\tport=%d\n", pData->server1.port);
|
||||
@ -759,7 +771,8 @@ CODESTARTdbgPrintInstInfo
|
||||
dbgprintf("\tdurable=%d\n", pData->durable);
|
||||
dbgprintf("\tpopulate_properties=%s\n", (pData->populate_properties)?"ON":"OFF");
|
||||
dbgprintf((pData->delivery_mode == 1) ? "\tdelivery_mode=TRANSIENT\n": "\tdelivery_mode=PERSISTANT\n");
|
||||
dbgprintf((pData->expiration.len == 0) ? "\texpiration=UNLIMITED\n" : "\texpiration=%*s\n", (int)pData->expiration.len, (char*) pData->expiration.bytes);
|
||||
dbgprintf((pData->expiration.len == 0) ? "\texpiration=UNLIMITED\n" : "\texpiration=%*s\n",
|
||||
(int)pData->expiration.len, (char*) pData->expiration.bytes);
|
||||
ENDdbgPrintInstInfo
|
||||
|
||||
BEGINnewActInst
|
||||
@ -829,14 +842,16 @@ CODESTARTnewActInst
|
||||
} else if (!strcmp(actpblk.descr[i].name, "durable")) {
|
||||
pData->durable = (int) pvals[i].val.d.n;
|
||||
} else {
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d: program error, non-handled param '%s'\n", pData->iidx, actpblk.descr[i].name);
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d: program error, non-handled param '%s'\n",
|
||||
pData->iidx, actpblk.descr[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
/* let's check config validity */
|
||||
|
||||
/* first if a template for routing_key is set let verify its existence */
|
||||
if (pData->routing_key_template && tplFind(ourConf, (char*)pData->routing_key_template, strlen((char*)pData->routing_key_template)) == NULL)
|
||||
if (pData->routing_key_template && tplFind(ourConf, (char*)pData->routing_key_template,
|
||||
strlen((char*)pData->routing_key_template)) == NULL)
|
||||
{
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d : template '%s' used for routing key does not exist !",
|
||||
pData->iidx, pData->routing_key_template);
|
||||
@ -845,26 +860,30 @@ CODESTARTnewActInst
|
||||
|
||||
/* an exchange must be defined */
|
||||
if (pData->exchange.bytes == NULL) {
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d disabled: parameter exchange must be specified", pData->iidx);
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d disabled: parameter exchange must be specified",
|
||||
pData->iidx);
|
||||
ABORT_FINALIZE(RS_RET_CONFIG_ERROR);
|
||||
}
|
||||
|
||||
/* a static or a template's routing_key must be defined */
|
||||
if (pData->routing_key.bytes == NULL && pData->routing_key_template == NULL) {
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d disabled: one of parameters routing_key or routing_key_template must be specified", pData->iidx);
|
||||
LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module %d disabled: one of parameters routing_key or "
|
||||
"routing_key_template must be specified", pData->iidx);
|
||||
ABORT_FINALIZE(RS_RET_CONFIG_ERROR);
|
||||
}
|
||||
|
||||
/* a valid delivery mode must be defined : a 0 means that an invalid value has been done */
|
||||
if (!pData->delivery_mode)
|
||||
{
|
||||
LogError(0, RS_RET_CONF_PARAM_INVLD, "omrabbitmq module %d disabled: parameters delivery_mode must be TRANSIENT or PERSISTANT (default)", pData->iidx);
|
||||
LogError(0, RS_RET_CONF_PARAM_INVLD, "omrabbitmq module %d disabled: parameters delivery_mode must be "
|
||||
"TRANSIENT or PERSISTANT (default)", pData->iidx);
|
||||
ABORT_FINALIZE(RS_RET_CONFIG_ERROR);
|
||||
}
|
||||
|
||||
/* an expiration must be positive */
|
||||
if (expiration < 0) {
|
||||
LogError(0, RS_RET_CONF_PARAM_INVLD, "omrabbitmq module %d disabled: parameters expiration must be a positive integer", pData->iidx);
|
||||
LogError(0, RS_RET_CONF_PARAM_INVLD, "omrabbitmq module %d disabled: parameters expiration must be a "
|
||||
" positive integer", pData->iidx);
|
||||
ABORT_FINALIZE(RS_RET_CONFIG_ERROR);
|
||||
}
|
||||
|
||||
@ -877,7 +896,8 @@ CODESTARTnewActInst
|
||||
}
|
||||
|
||||
/* Let's define the size of the doAction tab */
|
||||
CODE_STD_STRING_REQUESTnewActInst(1 + ((pData->routing_key_template) ? 1 : 0) + ((pData->body_template && *pData->body_template == '\0') ? 0 : 1));
|
||||
CODE_STD_STRING_REQUESTnewActInst(1 + ((pData->routing_key_template) ? 1 : 0) +
|
||||
((pData->body_template && *pData->body_template == '\0') ? 0 : 1));
|
||||
|
||||
/* Set the plain text message props */
|
||||
memset(&pData->amqp_props_plaintext, 0, sizeof(amqp_basic_properties_t));
|
||||
@ -916,7 +936,8 @@ CODESTARTnewActInst
|
||||
else if (*pData->body_template)
|
||||
{
|
||||
pData->idx_body_template = pData->idx_routing_key_template + 1;
|
||||
CHKiRet(OMSRsetEntry(*ppOMSR, pData->idx_body_template, (uchar*)strdup((const char *)pData->body_template), OMSR_NO_RQD_TPL_OPTS));
|
||||
CHKiRet(OMSRsetEntry(*ppOMSR, pData->idx_body_template, (uchar*)strdup((const char *)pData->body_template),
|
||||
OMSR_NO_RQD_TPL_OPTS));
|
||||
pData->amqp_props_tpl_type.content_type = amqp_cstring_bytes((pData->content_type)
|
||||
? pData->content_type
|
||||
: (char*)pData->body_template);
|
||||
|
||||
@ -154,7 +154,7 @@ struct instanceConf_s {
|
||||
sbool fileNotFoundError;
|
||||
int maxLinesAtOnce;
|
||||
uint32_t trimLineOverBytes;
|
||||
int msgFlag;
|
||||
int msgFlag;
|
||||
ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */
|
||||
struct instanceConf_s *next;
|
||||
};
|
||||
@ -1306,7 +1306,7 @@ enqLine(act_obj_t *const act,
|
||||
srSleep(inst->delay_perMsg % 1000000, inst->delay_perMsg / 1000000);
|
||||
}
|
||||
|
||||
pMsg->msgFlags = pMsg->msgFlags | inst->msgFlag;
|
||||
pMsg->msgFlags = pMsg->msgFlags | inst->msgFlag;
|
||||
|
||||
ratelimitAddMsg(act->ratelimiter, &act->multiSub, pMsg);
|
||||
finalize_it:
|
||||
|
||||
@ -360,7 +360,7 @@ finalize_it:
|
||||
static rsRetVal
|
||||
addData(instanceData *pData, uchar *buf)
|
||||
{
|
||||
size_t len;
|
||||
size_t len;
|
||||
DEFiRet;
|
||||
|
||||
len = strlen((char*)buf);
|
||||
|
||||
@ -83,34 +83,34 @@ STATSCOUNTER_DEF(ctrKafkaRespOther, mutCtrKafkaRespOther);
|
||||
|
||||
#ifndef SLIST_INIT
|
||||
#define SLIST_INIT(head) do { \
|
||||
(head)->slh_first = NULL; \
|
||||
(head)->slh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
#endif
|
||||
|
||||
#ifndef SLIST_ENTRY
|
||||
#define SLIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SLIST_HEAD
|
||||
#define SLIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *slh_first; /* first element */ \
|
||||
struct type *slh_first; /* first element */ \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SLIST_INSERT_HEAD
|
||||
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
(head)->slh_first = (elm); \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
(head)->slh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
#endif
|
||||
|
||||
#ifndef SLIST_REMOVE_HEAD
|
||||
#define SLIST_REMOVE_HEAD(head, field) do { \
|
||||
(head)->slh_first = (head)->slh_first->field.sle_next; \
|
||||
(head)->slh_first = (head)->slh_first->field.sle_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
#endif
|
||||
|
||||
@ -128,16 +128,15 @@ struct name { \
|
||||
|
||||
#ifndef SLIST_REMOVE
|
||||
#define SLIST_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->slh_first == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->slh_first; \
|
||||
while(curelm->field.sle_next != (elm)) \
|
||||
curelm = curelm->field.sle_next; \
|
||||
curelm->field.sle_next = \
|
||||
curelm->field.sle_next->field.sle_next; \
|
||||
} \
|
||||
if ((head)->slh_first == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->slh_first; \
|
||||
while(curelm->field.sle_next != (elm)) \
|
||||
curelm = curelm->field.sle_next; \
|
||||
curelm->field.sle_next = curelm->field.sle_next->field.sle_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
#endif
|
||||
|
||||
|
||||
@ -909,10 +909,10 @@ static void modPrintList(void)
|
||||
NULL : pMod->mod.om.newActInst);
|
||||
dbgprintf("\ttryResume: %p\n", pMod->tryResume);
|
||||
dbgprintf("\tdoHUP: %p\n", pMod->doHUP);
|
||||
dbgprintf("\tBeginTransaction: %p\n", ((pMod->mod.om.beginTransaction == dummyBeginTransaction) ?
|
||||
NULL : pMod->mod.om.beginTransaction));
|
||||
dbgprintf("\tEndTransaction: %p\n", ((pMod->mod.om.endTransaction == dummyEndTransaction) ?
|
||||
NULL : pMod->mod.om.endTransaction));
|
||||
dbgprintf("\tBeginTransaction: %p\n", ((pMod->mod.om.beginTransaction ==
|
||||
dummyBeginTransaction) ? NULL : pMod->mod.om.beginTransaction));
|
||||
dbgprintf("\tEndTransaction: %p\n", ((pMod->mod.om.endTransaction ==
|
||||
dummyEndTransaction) ? NULL : pMod->mod.om.endTransaction));
|
||||
break;
|
||||
case eMOD_IN:
|
||||
dbgprintf("Input Module Entry Points\n");
|
||||
@ -1091,7 +1091,7 @@ Load(uchar *const pModName, const sbool bConfLoad, struct nvlst *const lst)
|
||||
{
|
||||
size_t iPathLen, iModNameLen;
|
||||
int bHasExtension;
|
||||
void *pModHdlr;
|
||||
void *pModHdlr;
|
||||
pModInit_t pModInit;
|
||||
modInfo_t *pModInfo;
|
||||
cfgmodules_etry_t *pNew = NULL;
|
||||
|
||||
@ -376,26 +376,26 @@ static char hexdigit[16] =
|
||||
#if defined(_AIX)
|
||||
/* AIXPORT : replace facility names with aso and caa only for AIX */
|
||||
static const char *syslog_fac_names[LOG_NFACILITIES] = { "kern", "user", "mail", "daemon", "auth", "syslog", "lpr",
|
||||
"news", "uucp", "cron", "authpriv", "ftp", "aso", "audit",
|
||||
"alert", "caa", "local0", "local1", "local2", "local3",
|
||||
"local4", "local5", "local6", "local7", "invld" };
|
||||
"news", "uucp", "cron", "authpriv", "ftp", "aso", "audit",
|
||||
"alert", "caa", "local0", "local1", "local2", "local3",
|
||||
"local4", "local5", "local6", "local7", "invld" };
|
||||
/* length of the facility names string (for optimizatiions) */
|
||||
static short len_syslog_fac_names[LOG_NFACILITIES] = { 4, 4, 4, 6, 4, 6, 3,
|
||||
4, 4, 4, 8, 3, 3, 5,
|
||||
5, 3, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 5 };
|
||||
4, 4, 4, 8, 3, 3, 5,
|
||||
5, 3, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 5 };
|
||||
|
||||
#else
|
||||
/*syslog facility names (as of RFC5424) */
|
||||
static const char *syslog_fac_names[LOG_NFACILITIES] = { "kern", "user", "mail", "daemon", "auth", "syslog", "lpr",
|
||||
"news", "uucp", "cron", "authpriv", "ftp", "ntp", "audit",
|
||||
"alert", "clock", "local0", "local1", "local2", "local3",
|
||||
"local4", "local5", "local6", "local7", "invld" };
|
||||
"news", "uucp", "cron", "authpriv", "ftp", "ntp", "audit",
|
||||
"alert", "clock", "local0", "local1", "local2", "local3",
|
||||
"local4", "local5", "local6", "local7", "invld" };
|
||||
/* length of the facility names string (for optimizatiions) */
|
||||
static short len_syslog_fac_names[LOG_NFACILITIES] = { 4, 4, 4, 6, 4, 6, 3,
|
||||
4, 4, 4, 8, 3, 3, 5,
|
||||
5, 5, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 5 };
|
||||
4, 4, 4, 8, 3, 3, 5,
|
||||
5, 5, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 5 };
|
||||
#endif
|
||||
|
||||
/* table of severity names (in numerical order)*/
|
||||
@ -640,8 +640,8 @@ propNameToID(uchar *pName, propid_t *pPropID)
|
||||
*pPropID = PROP_SYS_QHOUR;
|
||||
} else if(!strcasecmp((char*) pName, "$MINUTE")) {
|
||||
*pPropID = PROP_SYS_MINUTE;
|
||||
} else if(!strcasecmp((char*) pName, "$WDAY")) {
|
||||
*pPropID = PROP_SYS_WDAY;
|
||||
} else if(!strcasecmp((char*) pName, "$WDAY")) {
|
||||
*pPropID = PROP_SYS_WDAY;
|
||||
} else if(!strcasecmp((char*) pName, "$now-utc")) {
|
||||
*pPropID = PROP_SYS_NOW_UTC;
|
||||
} else if(!strcasecmp((char*) pName, "$year-utc")) {
|
||||
@ -658,8 +658,8 @@ propNameToID(uchar *pName, propid_t *pPropID)
|
||||
*pPropID = PROP_SYS_QHOUR_UTC;
|
||||
} else if(!strcasecmp((char*) pName, "$minute-utc")) {
|
||||
*pPropID = PROP_SYS_MINUTE_UTC;
|
||||
} else if(!strcasecmp((char*) pName, "$wday-utc")) {
|
||||
*pPropID = PROP_SYS_WDAY_UTC;
|
||||
} else if(!strcasecmp((char*) pName, "$wday-utc")) {
|
||||
*pPropID = PROP_SYS_WDAY_UTC;
|
||||
} else if(!strcasecmp((char*) pName, "$MYHOSTNAME")) {
|
||||
*pPropID = PROP_SYS_MYHOSTNAME;
|
||||
} else if(!strcasecmp((char*) pName, "$!all-json")) {
|
||||
@ -776,10 +776,10 @@ uchar *propIDToName(propid_t propID)
|
||||
return UCHAR_CONSTANT("$QHOUR-UTC");
|
||||
case PROP_SYS_MINUTE_UTC:
|
||||
return UCHAR_CONSTANT("$MINUTE-UTC");
|
||||
case PROP_SYS_WDAY:
|
||||
return UCHAR_CONSTANT("$WDAY");
|
||||
case PROP_SYS_WDAY_UTC:
|
||||
return UCHAR_CONSTANT("$WDAY-UTC");
|
||||
case PROP_SYS_WDAY:
|
||||
return UCHAR_CONSTANT("$WDAY");
|
||||
case PROP_SYS_WDAY_UTC:
|
||||
return UCHAR_CONSTANT("$WDAY-UTC");
|
||||
case PROP_SYS_MYHOSTNAME:
|
||||
return UCHAR_CONSTANT("$MYHOSTNAME");
|
||||
case PROP_CEE_ALL_JSON:
|
||||
@ -3717,22 +3717,22 @@ uchar *MsgGetProp(smsg_t *__restrict__ const pMsg, struct templateEntry *__restr
|
||||
bufLen = 2;
|
||||
}
|
||||
break;
|
||||
case PROP_SYS_WDAY:
|
||||
if((pRes = getNOW(NOW_WDAY, ttNow, TIME_IN_LOCALTIME)) == NULL) {
|
||||
RET_OUT_OF_MEMORY;
|
||||
} else {
|
||||
*pbMustBeFreed = 1;
|
||||
bufLen = 2;
|
||||
}
|
||||
break;
|
||||
case PROP_SYS_WDAY_UTC:
|
||||
if((pRes = getNOW(NOW_WDAY, ttNow, TIME_IN_UTC)) == NULL) {
|
||||
RET_OUT_OF_MEMORY;
|
||||
} else {
|
||||
*pbMustBeFreed = 1;
|
||||
bufLen = 2;
|
||||
}
|
||||
break;
|
||||
case PROP_SYS_WDAY:
|
||||
if((pRes = getNOW(NOW_WDAY, ttNow, TIME_IN_LOCALTIME)) == NULL) {
|
||||
RET_OUT_OF_MEMORY;
|
||||
} else {
|
||||
*pbMustBeFreed = 1;
|
||||
bufLen = 2;
|
||||
}
|
||||
break;
|
||||
case PROP_SYS_WDAY_UTC:
|
||||
if((pRes = getNOW(NOW_WDAY, ttNow, TIME_IN_UTC)) == NULL) {
|
||||
RET_OUT_OF_MEMORY;
|
||||
} else {
|
||||
*pbMustBeFreed = 1;
|
||||
bufLen = 2;
|
||||
}
|
||||
break;
|
||||
case PROP_SYS_MYHOSTNAME:
|
||||
pRes = glbl.GetLocalHostName();
|
||||
break;
|
||||
|
||||
@ -306,7 +306,7 @@ BEGINObjClassInit(nsdpoll_ptcp, 1, OBJ_IS_CORE_MODULE) /* class, version */
|
||||
/* set our own handlers */
|
||||
ENDObjClassInit(nsdpoll_ptcp)
|
||||
#else
|
||||
|
||||
|
||||
static void dummy() {}
|
||||
|
||||
#endif /* #ifdef HAVE_EPOLL_CREATE this module requires epoll! */
|
||||
|
||||
@ -542,11 +542,11 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
|
||||
RS_RET_POLL_ERR = -2444, /**< error in poll() system call */
|
||||
RS_RET_OVERSIZE_MSG = -2445, /**< message is too long (above configured max) */
|
||||
RS_RET_TLS_KEY_ERR = -2446, /**< TLS KEY has problems */
|
||||
RS_RET_RABBITMQ_CONN_ERR = -2447, /**< RabbitMQ Connection error */
|
||||
RS_RET_RABBITMQ_LOGIN_ERR = -2448, /**< RabbitMQ Login error */
|
||||
RS_RET_RABBITMQ_CHANNEL_ERR = -2449, /**< RabbitMQ Connection error */
|
||||
RS_RET_RABBITMQ_INSUFFISANT_PRIVILEGES_ERR = -2450, /**< RabbitMQ Unable to */
|
||||
RS_RET_RABBITMQ_MSG_RETURNED_ERR = -2451, /**< RabbitMQ Message return */
|
||||
RS_RET_RABBITMQ_CONN_ERR = -2447, /**< RabbitMQ Connection error */
|
||||
RS_RET_RABBITMQ_LOGIN_ERR = -2448, /**< RabbitMQ Login error */
|
||||
RS_RET_RABBITMQ_CHANNEL_ERR = -2449, /**< RabbitMQ Connection error */
|
||||
RS_RET_RABBITMQ_INSUFFISANT_PRIVILEGES_ERR = -2450, /**< RabbitMQ Unable to */
|
||||
RS_RET_RABBITMQ_MSG_RETURNED_ERR = -2451, /**< RabbitMQ Message return */
|
||||
|
||||
/* RainerScript error messages (range 1000.. 1999) */
|
||||
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */
|
||||
|
||||
@ -127,13 +127,11 @@ dosrcpacket(msgno, txt, len)
|
||||
|
||||
static void aix_close_it(int i)
|
||||
{
|
||||
if(src_exists)
|
||||
{
|
||||
if(i != SRC_FD)
|
||||
(void)close(i);
|
||||
}
|
||||
else
|
||||
close(i);
|
||||
if(src_exists) {
|
||||
if(i != SRC_FD)
|
||||
(void)close(i);
|
||||
} else
|
||||
close(i);
|
||||
}
|
||||
|
||||
|
||||
@ -419,11 +417,11 @@ forkRsyslog(void)
|
||||
exit(1);
|
||||
}
|
||||
AIX_SRC_EXISTS_IF /* AIXPORT */
|
||||
cpid = fork();
|
||||
if(cpid == -1) {
|
||||
perror("error forking rsyslogd process - terminating");
|
||||
exit(1);
|
||||
}
|
||||
cpid = fork();
|
||||
if(cpid == -1) {
|
||||
perror("error forking rsyslogd process - terminating");
|
||||
exit(1);
|
||||
}
|
||||
AIX_SRC_EXISTS_FI /* AIXPORT */
|
||||
|
||||
if(cpid == 0) {
|
||||
@ -549,8 +547,9 @@ printVersion(void)
|
||||
/* we keep the following message to so that users don't need
|
||||
* to wonder.
|
||||
*/
|
||||
printf("\tConfig file:\t\t\t\t" PATH_CONFFILE "\n");
|
||||
printf("\tPID file:\t\t\t\t" PATH_PIDFILE "%s\n", PATH_PIDFILE[0]!='/'?" (relative to global workingdirectory)":"");
|
||||
printf("\tConfig file:\t\t\t\t" PATH_CONFFILE "\n");
|
||||
printf("\tPID file:\t\t\t\t" PATH_PIDFILE "%s\n", PATH_PIDFILE[0]!='/'?"
|
||||
(relative to global workingdirectory)":"");
|
||||
printf("\tNumber of Bits in RainerScript integers: 64\n");
|
||||
printf("\nSee https://www.rsyslog.com for more information.\n");
|
||||
}
|
||||
@ -1856,8 +1855,8 @@ wait_timeout(void)
|
||||
switch(srcpacket.subreq.action)
|
||||
{
|
||||
case START:
|
||||
dosrcpacket(SRC_SUBMSG,"ERROR: rsyslogd does not support this option.\n",
|
||||
sizeof(struct srcrep));
|
||||
dosrcpacket(SRC_SUBMSG,"ERROR: rsyslogd does not support this "
|
||||
"option.\n", sizeof(struct srcrep));
|
||||
break;
|
||||
case STOP:
|
||||
if (srcpacket.subreq.object == SUBSYSTEM) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user