aboutsummaryrefslogtreecommitdiff
path: root/sysklogd/logger.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-01-27 12:50:12 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-01-27 12:50:12 +0000
commitf470196a4144dd586f8b80efeef4aca39cf11514 (patch)
tree82fb31007e47f4eb2a31e8bb7bb9e6229a40dc36 /sysklogd/logger.c
parent61160dd0a155364d30b7009b69e2a15afa651a2c (diff)
downloadbusybox-w32-f470196a4144dd586f8b80efeef4aca39cf11514.tar.gz
busybox-w32-f470196a4144dd586f8b80efeef4aca39cf11514.tar.bz2
busybox-w32-f470196a4144dd586f8b80efeef4aca39cf11514.zip
- fix conflicting decls of syslog related facilitynames and prioritynames tables
Diffstat (limited to 'sysklogd/logger.c')
-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 @@
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11#ifndef CONFIG_SYSLOGD
12#if !defined CONFIG_SYSLOGD
13
14/* SYSLOG_NAMES defined to pull prioritynames[] and facilitynames[]
15 * from syslog.h. Grrrr - glibc puts those in _rwdata_! :( */
16#define SYSLOG_NAMES 12#define SYSLOG_NAMES
17#define SYSLOG_NAMES_CONST /* uclibc is saner :) */ 13#define SYSLOG_NAMES_CONST
18#include <sys/syslog.h> 14#include <syslog.h>
19
20#else 15#else
21#include <sys/syslog.h> 16/* brokenness alert. Everybody except dietlibc get's this wrong by neither
22# ifndef __dietlibc__ 17 * providing a typedef nor an extern for facilitynames and prioritynames
23 /* We have to do this since the header file defines static 18 * in syslog.h.
24 * structures. Argh.... bad libc, bad, bad... 19 */
25 */ 20# include <syslog.h>
26 typedef struct _code { 21# ifndef __dietlibc__
27 char *c_name; 22/* We have to do this since the header file does neither provide a sane type
28 int c_val; 23 * for this structure nor extern definitions. Argh.... bad libc, bad, bad...
29 } CODE; 24 */
30 extern CODE prioritynames[]; 25typedef struct _code {
31 extern CODE facilitynames[]; 26 char *c_name; /* FIXME: this should be const char *const c_name ! */
27 int c_val;
28} CODE;
29# ifdef __UCLIBC__
30extern const CODE prioritynames[];
31extern const CODE facilitynames[];
32# else
33extern CODE prioritynames[];
34extern CODE facilitynames[];
32# endif 35# endif
36# endif
33#endif 37#endif
34 38
35/* Decode a symbolic name to a numeric value 39/* Decode a symbolic name to a numeric value