diff options
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/klogd.c | 2 | ||||
-rw-r--r-- | sysklogd/logger.c | 42 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 10 |
3 files changed, 28 insertions, 26 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index 72f3b559c..d65b6f9a0 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "libbb.h" | 20 | #include "libbb.h" |
21 | #include <sys/syslog.h> | 21 | #include <syslog.h> |
22 | #include <sys/klog.h> | 22 | #include <sys/klog.h> |
23 | 23 | ||
24 | static void klogd_signal(int sig ATTRIBUTE_UNUSED) | 24 | static void klogd_signal(int sig ATTRIBUTE_UNUSED) |
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[]; | 25 | typedef 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__ | ||
30 | extern const CODE prioritynames[]; | ||
31 | extern const CODE facilitynames[]; | ||
32 | # else | ||
33 | extern CODE prioritynames[]; | ||
34 | extern 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 |
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 345bf0e87..de8aa04a8 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -14,14 +14,12 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "libbb.h" | 16 | #include "libbb.h" |
17 | #define SYSLOG_NAMES | ||
18 | #define SYSLOG_NAMES_CONST | ||
19 | #include <syslog.h> | ||
20 | |||
17 | #include <paths.h> | 21 | #include <paths.h> |
18 | #include <sys/un.h> | 22 | #include <sys/un.h> |
19 | |||
20 | /* SYSLOG_NAMES defined to pull prioritynames[] and facilitynames[] | ||
21 | * from syslog.h. Grrrr - glibc puts those in _rwdata_! :( */ | ||
22 | #define SYSLOG_NAMES | ||
23 | #define SYSLOG_NAMES_CONST /* uclibc is saner :) */ | ||
24 | #include <sys/syslog.h> | ||
25 | #include <sys/uio.h> | 23 | #include <sys/uio.h> |
26 | 24 | ||
27 | #if ENABLE_FEATURE_REMOTE_LOG | 25 | #if ENABLE_FEATURE_REMOTE_LOG |