diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-11-06 11:28:33 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-11-06 11:28:35 +0100 |
commit | 4a10d4e02897be37a517bc6e016e9d722086765e (patch) | |
tree | 8ece1da863a68a08d9503722dbe0debf6cab0dc9 | |
parent | bdcacad90830722339d1f11e5a1edfe5002c5ec2 (diff) | |
download | ubox-4a10d4e02897be37a517bc6e016e9d722086765e.tar.gz |
logread: use oneshot mode without -f, wait for logd to close
Fixes a race condition in dealing with larger amounts of log data
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | log/logread.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/log/logread.c b/log/logread.c index 994c88b..0cae75b 100644 --- a/log/logread.c +++ b/log/logread.c @@ -236,8 +236,6 @@ static void logread_fd_data_cb(struct ustream *s, int bytes) log_notify(a); ustream_consume(s, cur_len); } - if (!log_follow) - uloop_end(); } static void logread_fd_state_cb(struct ustream *s) @@ -337,6 +335,7 @@ int main(int argc, char **argv) blob_buf_init(&b, 0); blobmsg_add_u8(&b, "stream", 1); + blobmsg_add_u8(&b, "oneshot", !log_follow); if (lines) blobmsg_add_u32(&b, "lines", lines); else if (log_follow) |