diff options
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c index f90e4c1208..270819aec3 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "monitor/monitor.h" #include "sysemu/sysemu.h" #include "sysemu/block-backend.h" @@ -2798,6 +2799,13 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char *buf, size_t len) NULL); } + if (ret == QIO_CHANNEL_ERR_BLOCK) { + errno = EAGAIN; + ret = -1; + } else if (ret == -1) { + errno = EIO; + } + if (msgfds_num) { /* close and clean read_msgfds */ for (i = 0; i < s->read_msgfds_num; i++) { |