chiark / gitweb /
[PATCH] remove USE_DBUS and USE_SELINUX flags from the README as they are no longer...
[elogind.git] / logging.h
index 1c27917f61e4ed89ecc6e8b6b3a28f615c51d853..40c342c3ab0c04c7b2690c1e34548f06c49ee0ee 100644 (file)
--- 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);
 }