X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=log%2Flogd.c;h=cbaf2193eb5bdcb80725a0f74f407a00782ae429;hp=978d7d198590afcff892249343c62c9c70d4995e;hb=dee0eafbf7de74b45f90631b7c807395e0a0bc4b;hpb=f8d43c5f222b99d5a7a0e2bd1fdc0d442e030e89 diff --git a/log/logd.c b/log/logd.c index 978d7d1..cbaf219 100644 --- a/log/logd.c +++ b/log/logd.c @@ -13,6 +13,7 @@ #include #include +#include #include @@ -169,12 +170,24 @@ 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_init(log_size); uloop_run(); if (_ctx) ubus_free(_ctx);