diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/errmsg.c | 2 | ||||
-rw-r--r-- | runtime/errmsg.h | 2 | ||||
-rw-r--r-- | runtime/rsyslog.c | 8 | ||||
-rw-r--r-- | runtime/rsyslog.h | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/runtime/errmsg.c b/runtime/errmsg.c index dcb5b185..55d013ea 100644 --- a/runtime/errmsg.c +++ b/runtime/errmsg.c @@ -57,7 +57,7 @@ DEFobjStaticHelpers * rgerhards, 2008-06-27 */ static void __attribute__((format(printf, 3, 4))) -LogError(int iErrno, int iErrCode, char *fmt, ... ) +LogError(int iErrno, int iErrCode, const char *fmt, ... ) { va_list ap; char buf[1024]; diff --git a/runtime/errmsg.h b/runtime/errmsg.h index dfa70c00..3f511ae5 100644 --- a/runtime/errmsg.h +++ b/runtime/errmsg.h @@ -34,7 +34,7 @@ typedef struct errmsg_s { /* interfaces */ BEGINinterface(errmsg) /* name must also be changed in ENDinterface macro! */ - void __attribute__((format(printf, 3, 4))) (*LogError)(int iErrno, int iErrCode, char *pszErrFmt, ... ); + void __attribute__((format(printf, 3, 4))) (*LogError)(const int iErrno, const int iErrCode, const char *pszErrFmt, ... ); ENDinterface(errmsg) #define errmsgCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ diff --git a/runtime/rsyslog.c b/runtime/rsyslog.c index 53c7855a..6523ae6d 100644 --- a/runtime/rsyslog.c +++ b/runtime/rsyslog.c @@ -86,11 +86,11 @@ int default_thr_sched_policy; #endif /* forward definitions */ -static rsRetVal dfltErrLogger(int, uchar *errMsg); +static rsRetVal dfltErrLogger(const int, const uchar *errMsg); /* globally visible static data - see comment in rsyslog.h for details */ uchar *glblModPath; /* module load path */ -rsRetVal (*glblErrLogger)(int, uchar*) = dfltErrLogger; /* the error logger to use by the errmsg module */ +rsRetVal (*glblErrLogger)(const int, const uchar*) = dfltErrLogger; /* the error logger to use by the errmsg module */ /* static data */ static int iRefCount = 0; /* our refcount - it MUST exist only once inside a process (not thread) @@ -102,7 +102,7 @@ static int iRefCount = 0; /* our refcount - it MUST exist only once inside a pro * default so that we can log errors during the intial phase, most importantly * during initialization. -- rgerhards. 2008-04-17 */ -static rsRetVal dfltErrLogger(int iErr, uchar *errMsg) +static rsRetVal dfltErrLogger(const int iErr, const uchar *errMsg) { DEFiRet; fprintf(stderr, "rsyslog runtime error(%d): %s\n", iErr, errMsg); @@ -114,7 +114,7 @@ static rsRetVal dfltErrLogger(int iErr, uchar *errMsg) * rgerhards, 2008-04-18 */ rsRetVal -rsrtSetErrLogger(rsRetVal (*errLogger)(int, uchar*)) +rsrtSetErrLogger(rsRetVal (*errLogger)(int, const uchar*)) { DEFiRet; assert(errLogger != NULL); diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index bf1c35bf..10e91215 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -505,13 +505,13 @@ void dbgprintf(char *, ...) __attribute__((format(printf, 1, 2))); * add them. -- rgerhards, 2008-04-17 */ extern uchar *glblModPath; /* module load path */ -extern rsRetVal (*glblErrLogger)(int, uchar*); +extern rsRetVal (*glblErrLogger)(int, const uchar*); /* some runtime prototypes */ rsRetVal rsrtInit(char **ppErrObj, obj_if_t *pObjIF); rsRetVal rsrtExit(void); int rsrtIsInit(void); -rsRetVal rsrtSetErrLogger(rsRetVal (*errLogger)(int, uchar*)); +rsRetVal rsrtSetErrLogger(rsRetVal (*errLogger)(int, const uchar*)); /* this define below is (later) intended to be used to implement empty * structs. TODO: check if compilers supports this and, if not, define |