aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorGravatar Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-04-11 10:22:45 +0000
committerGravatar Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-04-11 10:22:45 +0000
commitbaa9a71fa006bbd644ba3d7cc4b0625602712a26 (patch)
tree9d530a7b4a658d4d022acb5049f2cc8f2175c23e /sysklogd
parent21756c7d100bc1d4dc8877ddb266db05a31e8a62 (diff)
downloadbusybox-baa9a71fa006bbd644ba3d7cc4b0625602712a26.tar.gz
busybox-baa9a71fa006bbd644ba3d7cc4b0625602712a26.tar.bz2
- pull fix for SYSLOG_NAMES_CONST from trunk
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/logger.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 970b05dc6..090750173 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -8,28 +8,32 @@
*/
#include "libbb.h"
-
-#if !defined CONFIG_SYSLOGD
-
-/* SYSLOG_NAMES defined to pull prioritynames[] and facilitynames[]
- * from syslog.h. Grrrr - glibc puts those in _rwdata_! :( */
+#ifndef CONFIG_SYSLOGD
#define SYSLOG_NAMES
-#define SYSLOG_NAMES_CONST /* uclibc is saner :) */
-#include <sys/syslog.h>
-
+#define SYSLOG_NAMES_CONST
+#include <syslog.h>
#else
-#include <sys/syslog.h>
-# ifndef __dietlibc__
- /* We have to do this since the header file defines static
- * structures. Argh.... bad libc, bad, bad...
- */
- typedef struct _code {
- char *c_name;
- int c_val;
- } CODE;
- extern CODE prioritynames[];
- extern CODE facilitynames[];
+/* brokenness alert. Everybody except dietlibc get's this wrong by neither
+ * providing a typedef nor an extern for facilitynames and prioritynames
+ * in syslog.h.
+ */
+# include <syslog.h>
+# ifndef __dietlibc__
+/* We have to do this since the header file does neither provide a sane type
+ * for this structure nor extern definitions. Argh.... bad libc, bad, bad...
+ */
+typedef struct _code {
+ char *c_name; /* FIXME: this should be const char *const c_name ! */
+ int c_val;
+} CODE;
+# ifdef __UCLIBC__
+extern const CODE prioritynames[];
+extern const CODE facilitynames[];
+# else
+extern CODE prioritynames[];
+extern CODE facilitynames[];
# endif
+# endif
#endif
/* Decode a symbolic name to a numeric value