summaryrefslogtreecommitdiff
path: root/logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'logging.h')
-rw-r--r--logging.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/logging.h b/logging.h
index 1c27917f61..40c342c3ab 100644
--- a/logging.h
+++ b/logging.h
@@ -34,6 +34,8 @@
#include <unistd.h>
#include <syslog.h>
+#define LOGNAME_SIZE 42
+
#undef info
#define info(format, arg...) \
do { \
@@ -61,12 +63,12 @@ extern void log_message(int level, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
/* each program that uses syslog must declare this variable somewhere */
-extern unsigned char logname[42];
+extern unsigned char logname[LOGNAME_SIZE];
#undef init_logging
static inline void init_logging(char *program_name)
{
- snprintf(logname, 42,"%s[%d]", program_name, getpid());
+ snprintf(logname, LOGNAME_SIZE,"%s[%d]", program_name, getpid());
openlog(logname, 0, LOG_DAEMON);
}