From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9FBa-0000HP-UD for qemu-devel@nongnu.org; Tue, 04 May 2010 06:17:07 -0400 Received: from [140.186.70.92] (port=52217 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9FBZ-0000Go-0l for qemu-devel@nongnu.org; Tue, 04 May 2010 06:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9Ci0-00056j-Q1 for qemu-devel@nongnu.org; Tue, 04 May 2010 03:39:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22678) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Ci0-00056O-4T for qemu-devel@nongnu.org; Tue, 04 May 2010 03:38:24 -0400 Message-ID: <4BDFCEE3.8070601@redhat.com> Date: Tue, 04 May 2010 09:38:11 +0200 From: Gerd Hoffmann MIME-Version: 1.0 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> In-Reply-To: <1272957442-7832-3-git-send-email-amit.shah@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Amit Shah Cc: Paul Brook , qemu list , Juan Quintela 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 ... cheers, Gerd