diff --git a/kernel/relay.c b/kernel/relay.c index ad855017bc59de72ebf592fda7576edf6e245bb4..61134eb7a0c8a9b2d2e0557b33ff4fbd7ff96f31 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -370,7 +370,7 @@ void relay_reset(struct rchan *chan) if (!chan) return; - if (chan->is_global && chan->buf[0]) { + if (chan->is_global && chan->buf[0]) { __relay_reset(chan->buf[0], 0); return; } @@ -850,13 +850,13 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos) buf->subbufs_consumed = consumed; buf->bytes_consumed = 0; } - + produced = (produced % n_subbufs) * subbuf_size + buf->offset; consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed; if (consumed > produced) produced += n_subbufs * subbuf_size; - + if (consumed == produced) return 0;