logd: fix pipe close
authorJohn Crispin <blogic@openwrt.org>
Wed, 12 Mar 2014 04:01:42 +0000 (04:01 +0000)
committerJohn Crispin <blogic@openwrt.org>
Wed, 12 Mar 2014 06:06:38 +0000 (06:06 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
log/logd.c

index 0407f4c7b82392817fb1f7558a9c3617668548e1..5dd993298c680e76fd6ed8c1ca5c140cda4cb789 100644 (file)
@@ -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;