aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/klogd.c5
-rw-r--r--sysklogd/logger.c2
-rw-r--r--sysklogd/logread.c4
-rw-r--r--sysklogd/syslogd_and_logger.c1
4 files changed, 10 insertions, 2 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 03d65b37f..4db72110d 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -58,6 +58,7 @@
58//usage: "\n -n Run in foreground" 58//usage: "\n -n Run in foreground"
59 59
60#include "libbb.h" 60#include "libbb.h"
61#include "common_bufsiz.h"
61#include <syslog.h> 62#include <syslog.h>
62 63
63 64
@@ -147,7 +148,7 @@ static void klogd_close(void)
147 148
148#define log_buffer bb_common_bufsiz1 149#define log_buffer bb_common_bufsiz1
149enum { 150enum {
150 KLOGD_LOGBUF_SIZE = sizeof(log_buffer), 151 KLOGD_LOGBUF_SIZE = COMMON_BUFSIZE,
151 OPT_LEVEL = (1 << 0), 152 OPT_LEVEL = (1 << 0),
152 OPT_FOREGROUND = (1 << 1), 153 OPT_FOREGROUND = (1 << 1),
153}; 154};
@@ -173,6 +174,8 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
173 int opt; 174 int opt;
174 int used; 175 int used;
175 176
177 setup_common_bufsiz();
178
176 opt = getopt32(argv, "c:n", &opt_c); 179 opt = getopt32(argv, "c:n", &opt_c);
177 if (opt & OPT_LEVEL) { 180 if (opt & OPT_LEVEL) {
178 /* Valid levels are between 1 and 8 */ 181 /* Valid levels are between 1 and 8 */
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index b3ca85703..f9eafeb25 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -99,6 +99,8 @@ int logger_main(int argc UNUSED_PARAM, char **argv)
99 int opt; 99 int opt;
100 int i = 0; 100 int i = 0;
101 101
102 setup_common_bufsiz();
103
102 /* Fill out the name string early (may be overwritten later) */ 104 /* Fill out the name string early (may be overwritten later) */
103 str_t = uid2uname_utoa(geteuid()); 105 str_t = uid2uname_utoa(geteuid());
104 106
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 781a603b2..5b999730a 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -42,6 +42,7 @@
42//usage: "\n -F Same as -f, but dump buffer first" 42//usage: "\n -F Same as -f, but dump buffer first"
43 43
44#include "libbb.h" 44#include "libbb.h"
45#include "common_bufsiz.h"
45#include <sys/ipc.h> 46#include <sys/ipc.h>
46#include <sys/sem.h> 47#include <sys/sem.h>
47#include <sys/shm.h> 48#include <sys/shm.h>
@@ -67,11 +68,12 @@ struct globals {
67 struct sembuf SMrdn[2]; // {1, 0}, {0, +1, SEM_UNDO} 68 struct sembuf SMrdn[2]; // {1, 0}, {0, +1, SEM_UNDO}
68 struct shbuf_ds *shbuf; 69 struct shbuf_ds *shbuf;
69} FIX_ALIASING; 70} FIX_ALIASING;
70#define G (*(struct globals*)&bb_common_bufsiz1) 71#define G (*(struct globals*)bb_common_bufsiz1)
71#define SMrup (G.SMrup) 72#define SMrup (G.SMrup)
72#define SMrdn (G.SMrdn) 73#define SMrdn (G.SMrdn)
73#define shbuf (G.shbuf) 74#define shbuf (G.shbuf)
74#define INIT_G() do { \ 75#define INIT_G() do { \
76 setup_common_bufsiz(); \
75 memcpy(SMrup, init_sem, sizeof(init_sem)); \ 77 memcpy(SMrup, init_sem, sizeof(init_sem)); \
76} while (0) 78} while (0)
77 79
diff --git a/sysklogd/syslogd_and_logger.c b/sysklogd/syslogd_and_logger.c
index 0964f239c..6458a9332 100644
--- a/sysklogd/syslogd_and_logger.c
+++ b/sysklogd/syslogd_and_logger.c
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include "libbb.h" 10#include "libbb.h"
11#include "common_bufsiz.h"
11#define SYSLOG_NAMES 12#define SYSLOG_NAMES
12#define SYSLOG_NAMES_CONST 13#define SYSLOG_NAMES_CONST
13#include <syslog.h> 14#include <syslog.h>