From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ0J1-0008W9-Vc for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ0Iw-0006gB-7k for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:06:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ0Iv-0006g6-Vd for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:06:22 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q92B6LV1010795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Oct 2012 07:06:21 -0400 From: Juan Quintela In-Reply-To: <505C60FF.70205@redhat.com> (Paolo Bonzini's message of "Fri, 21 Sep 2012 14:43:43 +0200") References: <1348217255-22441-1-git-send-email-quintela@redhat.com> <1348217255-22441-26-git-send-email-quintela@redhat.com> <505C60FF.70205@redhat.com> Date: Tue, 02 Oct 2012 13:06:18 +0200 Message-ID: <871uhh9lqt.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 25/41] buffered_file: make buffered_flush return the error code Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > Il 21/09/2012 10:47, Juan Quintela ha scritto: >> Or the amount of data written if there is no error. Adjust all callers. >> >> Signed-off-by: Juan Quintela >> --- >> buffered_file.c | 32 ++++++++++++++++++++++++-------- >> 1 file changed, 24 insertions(+), 8 deletions(-) >> >> diff --git a/buffered_file.c b/buffered_file.c >> index 747d672..9db73dc 100644 >> --- a/buffered_file.c >> +++ b/buffered_file.c >> @@ -58,26 +58,26 @@ static void buffered_append(QEMUFileBuffered *s, >> s->buffer_size += size; >> } >> >> -static void buffered_flush(QEMUFileBuffered *s) >> +static int buffered_flush(QEMUFileBuffered *s) > > Should this be ssize_t? Done. > Perhaps the other way round: > > if (ret < 0) { > ret2 = -1; > } > ... > return ret2; This lost the 1st errno value. The other way around we preserve it. Later, Juan.