chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] be paranoid in dev_d.c
[elogind.git]
/
logging.h
diff --git
a/logging.h
b/logging.h
index 1c27917f61e4ed89ecc6e8b6b3a28f615c51d853..40c342c3ab0c04c7b2690c1e34548f06c49ee0ee 100644
(file)
--- a/
logging.h
+++ b/
logging.h
@@
-34,6
+34,8
@@
#include <unistd.h>
#include <syslog.h>
#include <unistd.h>
#include <syslog.h>
+#define LOGNAME_SIZE 42
+
#undef info
#define info(format, arg...) \
do { \
#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 */
__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)
{
#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);
}
openlog(logname, 0, LOG_DAEMON);
}