[Qemu-devel] Re: [PATCH v5 3/6] char: Let writers know how much data was written in case of errors

2010-05-04 Thread Gerd Hoffmann
On 05/04/10 13:31, Amit Shah wrote: On (Tue) May 04 2010 [13:24:58], Gerd Hoffmann wrote: @@ -531,8 +534,12 @@ static int unix_write(int fd, const uint8_t *buf, int len1) while (len> 0) { ret = write(fd, buf, len); if (ret< 0) { -if (errno != EINTR&&

[Qemu-devel] Re: [PATCH v5 3/6] char: Let writers know how much data was written in case of errors

2010-05-04 Thread Amit Shah
On (Tue) May 04 2010 [13:24:58], Gerd Hoffmann wrote: >> @@ -531,8 +534,12 @@ static int unix_write(int fd, const uint8_t *buf, int >> len1) >> while (len> 0) { >> ret = write(fd, buf, len); >> if (ret< 0) { >> -if (errno != EINTR&& errno != EAGAIN) >> +

[Qemu-devel] Re: [PATCH v5 3/6] char: Let writers know how much data was written in case of errors

2010-05-04 Thread Gerd Hoffmann
@@ -531,8 +534,12 @@ static int unix_write(int fd, const uint8_t *buf, int len1) while (len> 0) { ret = write(fd, buf, len); if (ret< 0) { -if (errno != EINTR&& errno != EAGAIN) +if (len1 - len) { +return len1 - len; +