X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=logging.h;h=40c342c3ab0c04c7b2690c1e34548f06c49ee0ee;hp=1c27917f61e4ed89ecc6e8b6b3a28f615c51d853;hb=5476249ffd3239cbfad91999db3917dc292b158f;hpb=3fe0734266becd2ebcb111b07c3e17b2a9780477 diff --git a/logging.h b/logging.h index 1c27917f6..40c342c3a 100644 --- a/logging.h +++ b/logging.h @@ -34,6 +34,8 @@ #include #include +#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); }