Paolo Bonzini <pbonz...@redhat.com> 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 <quint...@redhat.com> >> --- >> 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.