From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1busaU-0002Hr-K5 for qemu-devel@nongnu.org; Thu, 13 Oct 2016 22:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1busaP-00081M-OP for qemu-devel@nongnu.org; Thu, 13 Oct 2016 22:51:10 -0400 Date: Fri, 14 Oct 2016 10:50:58 +0800 From: Fam Zheng Message-ID: <20161014025058.GA14830@lemon> References: <1476199177-32411-1-git-send-email-thuth@redhat.com> <1476199177-32411-3-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476199177-32411-3-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/3] tests/boot-sector: Use mkstemp() to create a unique file name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-devel@nongnu.org, Peter Maydell , Paolo Bonzini , Victor Kaplansky , Michael Tsirkin , qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, Sascha Silbe , David Gibson On Tue, 10/11 17:19, Thomas Huth wrote: > The pxe-test is run for three different targets now (x86_64, i386 > and ppc64), and the bios-tables-test is run for two targets (x86_64 > and i386). But each of the tests is using an invariant name for the > disk image with the boot sector code - so if the tests are running in > parallel, there is a race condition that they destroy the disk image > of a parallel test program. Let's use mkstemp() to create unique > temporary files here instead - and since mkstemp() is returning an > integer file descriptor instead of a FILE pointer, we also switch > the fwrite() and fclose() to write() and close() instead. > > Reported-by: Sascha Silbe > Signed-off-by: Thomas Huth Tested-by: Fam Zheng