From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmQu4-0004nM-4Y for qemu-devel@nongnu.org; Fri, 29 Nov 2013 11:27:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmQtv-0004hB-Nr for qemu-devel@nongnu.org; Fri, 29 Nov 2013 11:26:52 -0500 Received: from mail-ie0-x22b.google.com ([2607:f8b0:4001:c03::22b]:49165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmQtv-0004gl-Ie for qemu-devel@nongnu.org; Fri, 29 Nov 2013 11:26:43 -0500 Received: by mail-ie0-f171.google.com with SMTP id ar20so16924531iec.30 for ; Fri, 29 Nov 2013 08:26:43 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5298C03E.1@redhat.com> Date: Fri, 29 Nov 2013 17:26:38 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385662155-15212-1-git-send-email-lersek@redhat.com> <1385662155-15212-4-git-send-email-lersek@redhat.com> <87y547l39a.fsf@blackfin.pond.sub.org> <5298AD9C.50001@redhat.com> In-Reply-To: <5298AD9C.50001@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/4] i440fx-test: generate temporary firmware blob List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: Markus Armbruster , qemu-devel@nongnu.org Il 29/11/2013 16:07, Laszlo Ersek ha scritto: > I think that the way I did it here matches this situation well. After > the g_file_open_tmp() call succeeds, we must close fd in any case > (independently of whether as a whole the function succeeds or not). > Optionally, we must also unlink the file, in the same logical spot where > the close() is. (Because g_file_open() creates three resources at once, > a node in the filesystem, a file descriptor in the process, and a > dynamically allocated string.) I agree that the way you wrote it makes sense if you do not use goto. Paolo