Fixed off-by-one bug in async output buffers.
This commit is contained in:
parent
6ee9a5e718
commit
e85220dd0b
|
@ -270,7 +270,7 @@ static void comm_notification(int fd,void*private)
|
||||||
/* write from output queue */
|
/* write from output queue */
|
||||||
prev = comm_outbuf(ptr);
|
prev = comm_outbuf(ptr);
|
||||||
do {
|
do {
|
||||||
bleft = ((ptr->obuf_tail < ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size)
|
bleft = ((ptr->obuf_tail <= ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size)
|
||||||
- ptr->obuf_tail;
|
- ptr->obuf_tail;
|
||||||
len = bleft ? write(fd, ptr->outbuf + ptr->obuf_tail, bleft) : 0;
|
len = bleft ? write(fd, ptr->outbuf + ptr->obuf_tail, bleft) : 0;
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
|
Loading…
Reference in New Issue