aboutsummaryrefslogtreecommitdiff
path: root/sysklogd/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd/syslogd.c')
-rw-r--r--sysklogd/syslogd.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 1b8d718f4..b9af9c55f 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -13,10 +13,13 @@
13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
14 */ 14 */
15 15
16/*
17 * Done in syslogd_and_logger.c:
16#include "libbb.h" 18#include "libbb.h"
17#define SYSLOG_NAMES 19#define SYSLOG_NAMES
18#define SYSLOG_NAMES_CONST 20#define SYSLOG_NAMES_CONST
19#include <syslog.h> 21#include <syslog.h>
22*/
20 23
21#include <paths.h> 24#include <paths.h>
22#include <sys/un.h> 25#include <sys/un.h>
@@ -192,8 +195,8 @@ enum {
192#error Please check CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE 195#error Please check CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE
193#endif 196#endif
194 197
195/* our shared key */ 198/* our shared key (syslogd.c and logread.c must be in sync) */
196#define KEY_ID ((long)0x414e4547) /* "GENA" */ 199enum { KEY_ID = 0x414e4547 }; /* "GENA" */
197 200
198static void ipcsyslog_cleanup(void) 201static void ipcsyslog_cleanup(void)
199{ 202{
@@ -211,7 +214,7 @@ static void ipcsyslog_cleanup(void)
211static void ipcsyslog_init(void) 214static void ipcsyslog_init(void)
212{ 215{
213 if (DEBUG) 216 if (DEBUG)
214 printf("shmget(%lx, %d,...)\n", KEY_ID, G.shm_size); 217 printf("shmget(%x, %d,...)\n", (int)KEY_ID, G.shm_size);
215 218
216 G.shmid = shmget(KEY_ID, G.shm_size, IPC_CREAT | 0644); 219 G.shmid = shmget(KEY_ID, G.shm_size, IPC_CREAT | 0644);
217 if (G.shmid == -1) { 220 if (G.shmid == -1) {
@@ -631,6 +634,7 @@ static void do_syslogd(void)
631 split_escape_and_log(recvbuf, sz); 634 split_escape_and_log(recvbuf, sz);
632 } 635 }
633 } /* for (;;) */ 636 } /* for (;;) */
637#undef recvbuf
634} 638}
635 639
636int syslogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 640int syslogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -682,3 +686,11 @@ int syslogd_main(int argc ATTRIBUTE_UNUSED, char **argv)
682 do_syslogd(); 686 do_syslogd();
683 /* return EXIT_SUCCESS; */ 687 /* return EXIT_SUCCESS; */
684} 688}
689
690/* Clean up. Needed because we are included from syslogd_and_logger.c */
691#undef G
692#undef GLOBALS
693#undef INIT_G
694#undef OPTION_STR
695#undef OPTION_DECL
696#undef OPTION_PARAM