From patchwork Thu Nov 10 12:41:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 124867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 36F8E1007D1 for ; Thu, 10 Nov 2011 23:44:27 +1100 (EST) Received: from localhost ([::1]:37703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTzU-0000mD-G6 for incoming@patchwork.ozlabs.org; Thu, 10 Nov 2011 07:44:24 -0500 Received: from eggs.gnu.org ([140.186.70.92]:58342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTyV-0006Z2-Db for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROTyU-0006rS-9B for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTyT-0006r3-QX for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:22 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAAChKuH018064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2011 07:43:20 -0500 Received: from blackpad.lan.raisama.net (ovpn-113-78.phx2.redhat.com [10.3.113.78]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAAChJ1t001350; Thu, 10 Nov 2011 07:43:19 -0500 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 4A8512033FB; Thu, 10 Nov 2011 10:41:49 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 10 Nov 2011 10:41:45 -0200 Message-Id: <1320928908-19076-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1320928908-19076-1-git-send-email-ehabkost@redhat.com> References: <1320928908-19076-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Michael Roth , Juan Quintela Subject: [Qemu-devel] [PATCH 07/10] stdio_fclose: return -errno on errors (v2) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is what qemu_fclose() expects. Changes v1 -> v2: - Add braces to if statement to match coding style Signed-off-by: Eduardo Habkost --- savevm.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/savevm.c b/savevm.c index a870b3f..4ccbc1c 100644 --- a/savevm.c +++ b/savevm.c @@ -245,9 +245,12 @@ static int stdio_pclose(void *opaque) static int stdio_fclose(void *opaque) { QEMUFileStdio *s = opaque; - fclose(s->stdio_file); + int ret = 0; + if (fclose(s->stdio_file) == EOF) { + ret = -errno; + } g_free(s); - return 0; + return ret; } QEMUFile *qemu_popen(FILE *stdio_file, const char *mode)