When qemu_chr_fe_write() can not write to a backend and there
is no error, it might return '0' to let the caller retry.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
chardev/char-hub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chardev/char-hub.c b/chardev/char-hub.c
index d0967c22336..4bbde9fb033 100644
--- a/chardev/char-hub.c
+++ b/chardev/char-hub.c
@@ -65,7 +65,7 @@ static int hub_chr_write(Chardev *chr, const uint8_t *buf, int len)
continue;
}
r = qemu_chr_fe_write(&d->backends[i].fe, buf, len);
- if (r < 0) {
+ if (r <= 0) {
if (errno == EAGAIN) {
/* Set index and expect to be called soon on watch wake up */
d->be_eagain_ind = i;
--
2.51.0