From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLsfA-0004TC-5g for qemu-devel@nongnu.org; Thu, 24 May 2018 12:00:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLsf7-00043Z-44 for qemu-devel@nongnu.org; Thu, 24 May 2018 12:00:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55464 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLsf6-00042o-Tx for qemu-devel@nongnu.org; Thu, 24 May 2018 12:00:20 -0400 References: <1527176250-178968-1-git-send-email-mst@redhat.com> From: Eric Blake Message-ID: <70262dde-3b96-b650-f0fb-8143e869c4ab@redhat.com> Date: Thu, 24 May 2018 11:00:19 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/1] libqtest: add more exit status checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Thomas Huth , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Markus Armbruster On 05/24/2018 10:52 AM, Eric Blake wrote: > Also, since waitpid() can only return either s->qemu_pid or -1 as we > aren't using WNOHANG, it may also be worth asserting that if pid == -1, > we either have EAGAIN (but why aren't we looping in that case?) or ECHILD. I meant EINTR, not EAGAIN. But in general, using waitpid() to collect process status without doing it in a loop is risky. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org