correct codestyle in rsyslog part 2

This commit is contained in:
PascalWithopf 2018-08-01 10:21:23 +02:00
parent 19133327cc
commit c83e3ed216
54 changed files with 1069 additions and 1018 deletions

View File

@ -19,6 +19,9 @@ rsyslog_stylecheck -l 120 compat/ifaddrs.h \
tests/inputfilegen.c \
tests/msleep.c \
tests/testconfgen.c \
tests/testbench.h \
tests/uxsockrcvr.c \
tests/tcpflood.c \
plugins/imfile/imfile.c \
plugins/imrelp/imrelp.c \
plugins/omrelp/omrelp.c \
@ -72,6 +75,11 @@ rsyslog_stylecheck -l 120 compat/ifaddrs.h \
plugins/mmanon/mmanon.c \
plugins/mmdblookup/mmdblookup.c \
plugins/omudpspoof/omudpspoof.c \
plugins/omsnmp/omsnmp.c \
plugins/imuxsock/imuxsock.c \
plugins/pmciscoios/pmciscoios.c \
plugins/imgssapi/imgssapi.c \
plugins/ommongodb/ommongodb.c \
grammar/testdriver.c \
runtime/netstrms.h \
runtime/lib_ksi_queue.h \
@ -149,6 +157,30 @@ rsyslog_stylecheck -l 120 compat/ifaddrs.h \
runtime/tcpsrv.h \
runtime/janitor.c \
runtime/linkedlist.c \
runtime/tcpsrv.c \
runtime/gss-misc.c \
runtime/obj.c \
runtime/hashtable/hashtable_utility.c \
runtime/conf.c \
runtime/hashtable_itr.h \
runtime/debug.c \
runtime/parser.h \
runtime/strmsrv.c \
runtime/queue.c \
runtime/lib_ksi_queue.c \
runtime/typedefs.h \
runtime/tcpclt.c \
runtime/statsobj.c \
runtime/dnscache.c \
runtime/unlimited_select.h \
runtime/srutils.c \
runtime/nsd_ptcp.c \
runtime/net.c \
runtime/msg.c \
runtime/hashtable_itr.c \
runtime/librsksi_read.c \
runtime/hashtable/tester.c \
runtime/hashtable.c \
contrib/mmkubernetes/mmkubernetes.c \
contrib/mmrfc5424addhmac/mmrfc5424addhmac.c \
contrib/mmcount/mmcount.c \
@ -166,5 +198,24 @@ rsyslog_stylecheck -l 120 compat/ifaddrs.h \
contrib/omhiredis/omhiredis.c \
contrib/omczmq/omczmq.c \
contrib/omrabbitmq/omrabbitmq.c \
compat/getifaddrs.c \
grammar/rainerscript.h \
grammar/rainerscript.c \
tools/omfile.c \
tools/rsyslogd.c \
tools/syncdemo.c \
tools/syslogd.c \
tools/logctl.c \
tools/omfwd.c \
tools/pmrfc3164.c \
tools/rscryutil.c \
tools/pmrfc5424.c \
tools/ompipe.c \
parse.c \
parse.h \
action.h
action.h \
template.h \
threads.c \
outchannel.c \
action.c \
template.c

View File

@ -965,7 +965,7 @@ checkDbgFile(const char *srcname)
* time being. -- rgerhards, 2008-01-29
*/
#ifndef DEBUGLESS
void
void
r_dbgoprint( const char *srcname, obj_t *pObj, const char *fmt, ...)
{
va_list ap;

View File

@ -18,8 +18,8 @@
/*
Credit for primes table: Aaron Krowne
http://br.endernet.org/~akrowne/
http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
http://br.endernet.org/~akrowne/
http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
*/
static const unsigned int primes[] = {
53, 97, 193, 389,

View File

@ -101,7 +101,7 @@ main(int argc, char **argv)
/*****************************************************************************/
/* Hashtable iteration */
/* Iterator constructor only returns a valid iterator if
/* Iterator constructor only returns a valid iterator if
* the hashtable is not empty */
itr = hashtable_iterator(h);
i = 0;

View File

@ -53,7 +53,7 @@ hashtable_iterator_remove(struct hashtable_itr *itr);
/*****************************************************************************/
/* search - overwrite the supplied iterator, to point to the entry
* matching the supplied key.
h points to the hashtable to be searched.
* h points to the hashtable to be searched.
* returns zero if not found. */
int
hashtable_iterator_search(struct hashtable_itr *itr,

View File

@ -161,7 +161,7 @@ bool ProtectedQueue_getItem(ProtectedQueue* this, size_t index, void** item) {
}
/* Waits for a new work item or timeout (if specified). Returns 0 in case of exit
condition, 1 if item became available and ETIMEDOUT in case of timeout. */
* condition, 1 if item became available and ETIMEDOUT in case of timeout. */
int ProtectedQueue_waitForItem(ProtectedQueue* this, void** item, uint64_t timeout) {
struct timespec ts;
pthread_mutex_lock(&this->mutex);

View File

@ -1025,7 +1025,7 @@ rsksi_printINT_HASH(FILE *fp, imprint_t *imp, uint8_t verbose)
*/
void
rsksi_printBLOCK_HDR(FILE *fp, block_hdr_t *bh, uint8_t verbose)
{
{
fprintf(fp, "[0x0901]Block Header Record:\n");
fprintf(fp, "\tPrevious Block Hash:\n");
fprintf(fp, "\t Algorithm..: %s\n", hashAlgNameKSI(bh->lastHash.hashID));

View File

@ -43,10 +43,10 @@
#include <libestr.h>
#include <json.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#include <malloc.h>
#endif
#ifdef USE_LIBUUID
#include <uuid/uuid.h>
#include <uuid/uuid.h>
#endif
#include <errno.h>
#include "rsyslog.h"
@ -374,19 +374,19 @@ static char hexdigit[16] =
{'0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'A', 'B', 'C', 'D', 'E', 'F' };
#if defined(_AIX)
/* AIXPORT : replace facility names with aso and caa only for AIX */
static char *syslog_fac_names[LOG_NFACILITIES] = { "kern", "user", "mail", "daemon", "auth", "syslog", "lpr",
#if defined(_AIX)
/* AIXPORT : replace facility names with aso and caa only for AIX */
static 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" };
/* length of the facility names string (for optimizatiions) */
static short len_syslog_fac_names[LOG_NFACILITIES] = { 4, 4, 4, 6, 4, 6, 3,
/* 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 };
#else
#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",

View File

@ -1082,8 +1082,8 @@ should_use_so_bsdcompat(void)
return 1;
}
/* Format is <version>.<patchlevel>.<sublevel><extraversion>
where the first three are unsigned integers and the last
is an arbitrary string. We only care about the first two. */
* where the first three are unsigned integers and the last
* is an arbitrary string. We only care about the first two. */
if (sscanf(myutsname.release, "%u.%u", &version, &patchlevel) != 2) {
dbgprintf("uname: unexpected release '%s'\r\n",
myutsname.release);

View File

@ -496,8 +496,8 @@ LstnInit(netstrms_t *pNS, void *pUsr, rsRetVal(*fAddLstn)(void*,netstrm_t*),
* could flood our log files by sending us tons of ICMP errors.
*/
/* AIXPORT : SO_BSDCOMPAT socket option is depricated , and its usage has been discontinued
on most unixes, AIX does not support this option , hence remove the call.
*/
* on most unixes, AIX does not support this option , hence remove the call.
*/
#if !defined(_AIX)
#ifndef BSD
if(net.should_use_so_bsdcompat()) {

View File

@ -27,7 +27,7 @@
#define INCLUDED_TYPEDEFS_H
#ifndef _AIX
#include <stdint.h>
#include <stdint.h>
#endif
#ifdef _AIX
#include "config.h"

View File

@ -55,7 +55,7 @@ static rsRetVal doInit(void) \
DEFiRet; \
char *pErrObj; /* tells us which object failed if that happens */ \
putenv("RSYSLOG_MODDIR=../runtime/.libs/"); /* this is a bit hackish... */ \
\
\
dbgClassInit(); \
/* Intialize the runtime system */ \
pErrObj = "rsyslog runtime"; /* set in case the runtime errors before setting an object */ \
@ -68,7 +68,7 @@ finalize_it: \
if(iRet != RS_RET_OK) { \
printf("failure occured during init of object '%s'\n", pErrObj); \
} \
\
\
RETiRet; \
}