X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=logging.h;h=40c342c3ab0c04c7b2690c1e34548f06c49ee0ee;hb=d00bd1724bd9f75f5a7b8e0368428c2f0d6d3c26;hp=1c27917f61e4ed89ecc6e8b6b3a28f615c51d853;hpb=56c963dc4d8a65a8f2f23ae329f2088fabbf3303;p=elogind.git 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); }