diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-09-22 20:20:29 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-09-22 20:28:22 +0200 |
commit | b824302bad8d73a5575d3bf1ede3e630fbb30dcd (patch) | |
tree | 0e9a43ba556fc687be434dc40691288ee4a01a16 /log | |
parent | 6dccebd14b2216bd8631f54df0e690bffa53b77f (diff) | |
download | ubox-b824302bad8d73a5575d3bf1ede3e630fbb30dcd.tar.gz |
logd: fix default initialization of line count
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'log')
-rw-r--r-- | log/logd.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)); |