summaryrefslogtreecommitdiff
path: root/log
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-03-12 04:01:42 +0000
committerJohn Crispin <blogic@openwrt.org>2014-03-12 06:06:38 +0000
commit3587778a620ae3ee50a3262cbed941344db3d4db (patch)
treee314087f34f87c0d1eaed786bf80e9a43bea7d2a /log
parent12728c38621c6271dd2102d3e11cf95ff42eeff8 (diff)
downloadubox-3587778a620ae3ee50a3262cbed941344db3d4db.tar.gz
logd: fix pipe close
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'log')
-rw-r--r--log/logd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/log/logd.c b/log/logd.c
index 0407f4c..5dd9932 100644
--- a/log/logd.c
+++ b/log/logd.c
@@ -57,17 +57,12 @@ client_close(struct ustream *s)
static void
client_notify_write(struct ustream *s, int bytes)
{
- if (s->w.data_bytes < 128 && ustream_read_blocked(s))
- ustream_set_read_blocked(s, false);
+ client_close(s);
}
static void client_notify_state(struct ustream *s)
{
- if (!s->eof)
- return;
-
- if (!s->w.data_bytes)
- return client_close(s);
+ return client_close(s);
}
static int
@@ -89,7 +84,6 @@ read_log(struct ubus_context *ctx, struct ubus_object *obj,
pipe(fds);
ubus_request_set_fd(ctx, req, fds[0]);
-
cl = calloc(1, sizeof(*cl));
cl->s.stream.notify_write = client_notify_write;
cl->s.stream.notify_state = client_notify_state;