From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9Eci-0004qy-Gq for qemu-devel@nongnu.org; Tue, 04 May 2010 05:41:04 -0400 Received: from [140.186.70.92] (port=50159 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9Ecf-0004qA-9U for qemu-devel@nongnu.org; Tue, 04 May 2010 05:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9D2u-00007n-8n for qemu-devel@nongnu.org; Tue, 04 May 2010 04:00:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4242) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9D2l-00006R-HF for qemu-devel@nongnu.org; Tue, 04 May 2010 03:59:55 -0400 Date: Tue, 4 May 2010 13:28:00 +0530 From: Amit Shah Message-ID: <20100504075800.GB8136@amit-x200.redhat.com> References: <1272957442-7832-1-git-send-email-amit.shah@redhat.com> <1272957442-7832-2-git-send-email-amit.shah@redhat.com> <1272957442-7832-3-git-send-email-amit.shah@redhat.com> <4BDFCEE3.8070601@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BDFCEE3.8070601@redhat.com> Subject: [Qemu-devel] Re: [PATCH v4 2/5] char: Add qemu_chr_write_nb() for nonblocking writes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paul Brook , qemu list , Juan Quintela On (Tue) May 04 2010 [09:38:11], Gerd Hoffmann wrote: > Hi, > >> -static int unix_write(int fd, const uint8_t *buf, int len1) >> +static int unix_write(int fd, const uint8_t *buf, int len1, bool nonblock) >> { >> int ret, len; >> >> @@ -522,6 +537,9 @@ 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 == EAGAIN&& nonblock) { >> + return -EAGAIN; >> + } > > You've just re-introduced the bug you've fixed in patch 1/5 ... Uh! Amit