Received: from eggs.gnu.org ([208.118.235.92]:41029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwXS9-0003xT-BC for qemu-devel@nongnu.org; Wed, 01 Aug 2012 07:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwXS6-0003a7-Tz for qemu-devel@nongnu.org; Wed, 01 Aug 2012 07:51:01 -0400 From: Markus Armbruster References: <1342539951-30915-1-git-send-email-akong@redhat.com> <1343811543-12137-2-git-send-email-akong@redhat.com> <20120801105011.GC17816@stefanha-thinkpad.localdomain> Date: Wed, 01 Aug 2012 13:50:54 +0200 In-Reply-To: (Peter Maydell's message of "Wed, 1 Aug 2012 12:23:02 +0100") Message-ID: <874nomespt.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-trivial] [RESEND PATCH 1/3] socket: remove redundant check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, quintela@redhat.com, qemu-trivial@nongnu.org, Stefan Hajnoczi , qemu-devel@nongnu.org, Amos Kong Peter Maydell writes: > On 1 August 2012 11:50, Stefan Hajnoczi wrote: >> This isn't obvious. It looks like the intent of the if (!e->ai_next) is >> to suppress the error so that the next iteration of the *outer* loop can >> succeed. > > Yeah, we only call it an error on the last time round. This > loop is a bit confusingly structured, since we're effectively > handling the failure in several places at once: we always > fprintf() something, then we set the error on the last time > round the loop, then at the end of the loop we fprintf again. > We also duplicate the loop termination condition. I cleaned it up some back in February, but my admittedly incremental improvement was rejected because it didn't also convert to error_set(). *shrug* http://lists.nongnu.org/archive/html/qemu-devel/2012-02/msg00772.html [...]