summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-01-22 13:57:07 +0000
committerJohn Crispin <blogic@openwrt.org>2014-01-22 13:57:07 +0000
commitcb6425ce059ddcd4ade45200fdcc39234ff500ad (patch)
tree3428cdf030f77402f1096a068c60f21f865bde02
parent2b32e9059166a23204fcf01e65a9184b3c39166b (diff)
downloadubox-cb6425ce059ddcd4ade45200fdcc39234ff500ad.tar.gz
logd: revert the log size changes
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r--log/logd.c15
-rw-r--r--log/syslog.c11
-rw-r--r--log/syslog.h2
3 files changed, 3 insertions, 25 deletions
diff --git a/log/logd.c b/log/logd.c
index cbaf219..978d7d1 100644
--- a/log/logd.c
+++ b/log/logd.c
@@ -13,7 +13,6 @@
#include <stdio.h>
#include <syslog.h>
-#include <unistd.h>
#include <linux/types.h>
@@ -170,24 +169,12 @@ ubus_connect_cb(struct uloop_timeout *timeout)
int
main(int argc, char **argv)
{
- int ch, log_size = 0;
-
signal(SIGPIPE, SIG_IGN);
- while ((ch = getopt(argc, argv, "S:")) != -1) {
- switch (ch) {
- case 'S':
- log_size = atoi(optarg);
- if (log_size < 1)
- log_size = 1;
- log_size *= 1024;
- break;
- }
- }
uloop_init();
ubus_timer.cb = ubus_connect_cb;
uloop_timeout_set(&ubus_timer, 1000);
- log_init(log_size);
+ log_init();
uloop_run();
if (_ctx)
ubus_free(_ctx);
diff --git a/log/syslog.c b/log/syslog.c
index d0b528d..fcc4a74 100644
--- a/log/syslog.c
+++ b/log/syslog.c
@@ -30,8 +30,6 @@
#include <libubox/usock.h>
#include <libubox/ustream.h>
-#include <ubusmsg.h>
-
#include "syslog.h"
#define LOG_DEFAULT_SIZE (16 * 1024)
@@ -276,15 +274,8 @@ log_buffer_init(int size)
}
void
-log_init(int _log_size)
+log_init(void)
{
- if (_log_size > 0)
- log_size = _log_size;
-
- /* reserve 512 bytes for protocol overhead */
- if (log_size > (UBUS_MAX_MSGLEN - 512))
- log_size = UBUS_MAX_MSGLEN - 512;
-
regcomp(&pat_prio, "^<([0-9]*)>(.*)", REG_EXTENDED);
regcomp(&pat_tstamp, "^\[[ 0]*([0-9]*).([0-9]*)] (.*)", REG_EXTENDED);
diff --git a/log/syslog.h b/log/syslog.h
index b682ced..dc712ff 100644
--- a/log/syslog.h
+++ b/log/syslog.h
@@ -30,7 +30,7 @@ struct log_head {
char data[];
};
-void log_init(int log_size);
+void log_init(void);
void log_shutdown(void);
typedef void (*log_list_cb)(struct log_head *h);