From b824302bad8d73a5575d3bf1ede3e630fbb30dcd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 22 Sep 2016 20:20:29 +0200 Subject: [PATCH] logd: fix default initialization of line count Signed-off-by: Felix Fietkau --- log/logd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/log/logd.c b/log/logd.c index 3f80459..58a1dec 100644 --- a/log/logd.c +++ b/log/logd.c @@ -92,6 +92,9 @@ read_log(struct ubus_context *ctx, struct ubus_object *obj, int ret; bool stream = true; + if (!stream) + count = 100; + if (msg) { blobmsg_parse(read_policy, __READ_MAX, tb, blob_data(msg), blob_len(msg)); if (tb[READ_LINES]) @@ -99,8 +102,6 @@ read_log(struct ubus_context *ctx, struct ubus_object *obj, if (tb[READ_STREAM]) stream = blobmsg_get_bool(tb[READ_STREAM]); } - if (!stream) - count = 100; if (pipe(fds) == -1) { fprintf(stderr, "logd: failed to create pipe: %s\n", strerror(errno)); -- 2.30.2