Re: [Qemu-devel] [PATCH] qemu-char: check errno together with ret < 0

2018-07-04 Thread Markus Armbruster
xinhua.Cao writes: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > we need check errno together with ret < 0. > > Signed-off-by: xinhua.Cao

Re: [Qemu-devel] [PATCH] qemu-char: check errno together with ret < 0

2018-07-04 Thread Paolo Bonzini
On 04/07/2018 11:36, Marc-André Lureau wrote: > On Wed, Jul 4, 2018 at 5:36 AM, xinhua.Cao wrote: >> In the tcp_chr_write function, we checked errno, >> but errno was not reset before a read or write operation. >> Therefore, this check of errno's actions is often >> incorrect after EAGAIN has occu

Re: [Qemu-devel] [PATCH] qemu-char: check errno together with ret < 0

2018-07-04 Thread Marc-André Lureau
On Wed, Jul 4, 2018 at 5:36 AM, xinhua.Cao wrote: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > we need check errno together with ret < 0. >

Re: [Qemu-devel] [PATCH] qemu-char: check errno together with ret < 0

2018-07-04 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 11:36:42AM +0800, xinhua.Cao wrote: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > we need check errno together with r

[Qemu-devel] [PATCH] qemu-char: check errno together with ret < 0

2018-07-03 Thread xinhua . Cao
In the tcp_chr_write function, we checked errno, but errno was not reset before a read or write operation. Therefore, this check of errno's actions is often incorrect after EAGAIN has occurred. we need check errno together with ret < 0. Signed-off-by: xinhua.Cao --- chardev/char-socket.c | 7 +++