libc: io: fix ringbuf_read/write not returning the correct values
This commit is contained in:
@@ -145,7 +145,7 @@ long __libc_ringbuf_read(struct ringbuf *buf, void *p, size_t count)
|
|||||||
|
|
||||||
memcpy(dest, src, to_copy);
|
memcpy(dest, src, to_copy);
|
||||||
|
|
||||||
nr_read += available;
|
nr_read += to_copy;
|
||||||
__libc_ringbuf_put_read_buffer(buf, &src, &to_copy);
|
__libc_ringbuf_put_read_buffer(buf, &src, &to_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ long __libc_ringbuf_write(struct ringbuf *buf, const void *p, size_t count)
|
|||||||
|
|
||||||
memcpy(dest, src, to_copy);
|
memcpy(dest, src, to_copy);
|
||||||
|
|
||||||
nr_written += available;
|
nr_written += to_copy;
|
||||||
__libc_ringbuf_put_write_buffer(buf, &dest, &to_copy);
|
__libc_ringbuf_put_write_buffer(buf, &dest, &to_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user