svn commit: branches/busybox_1_9_stable/sysklogd
aldot at busybox.net
aldot at busybox.net
Fri Apr 11 03:22:46 PDT 2008
Author: aldot
Date: 2008-04-11 03:22:45 -0700 (Fri, 11 Apr 2008)
New Revision: 21703
Log:
- pull fix for SYSLOG_NAMES_CONST from trunk
Modified:
branches/busybox_1_9_stable/sysklogd/logger.c
Changeset:
Modified: branches/busybox_1_9_stable/sysklogd/logger.c
===================================================================
--- branches/busybox_1_9_stable/sysklogd/logger.c 2008-04-11 10:22:12 UTC (rev 21702)
+++ branches/busybox_1_9_stable/sysklogd/logger.c 2008-04-11 10:22:45 UTC (rev 21703)
@@ -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
More information about the busybox-cvs
mailing list