Re: [Qemu-devel] [PATCH 2/2] check for close() errors on qcow2_create()

2010-10-08 Thread Eduardo Habkost
On Fri, Oct 08, 2010 at 10:28:37AM +0100, Stefan Hajnoczi wrote: > >  exit_close: > > -    close(fd); > > +    cret = close(fd); > > +    if (ret == 0 && cret < 0) > > if (close(fd) < 0 && ret == 0) { > > Does the same without variable cret. Yes. I used the variable just for readability. I perso

Re: [Qemu-devel] [PATCH 2/2] check for close() errors on qcow2_create()

2010-10-08 Thread Stefan Hajnoczi
On Thu, Oct 7, 2010 at 9:25 PM, Eduardo Habkost wrote: > Errors when closing the file we just created should not be ignored. I/O errors > may happen and "qemu-img create" should fail in those cases. > > If we are already exiting due to an error, we will still return the original > error number, th

[Qemu-devel] [PATCH 2/2] check for close() errors on qcow2_create()

2010-10-07 Thread Eduardo Habkost
Errors when closing the file we just created should not be ignored. I/O errors may happen and "qemu-img create" should fail in those cases. If we are already exiting due to an error, we will still return the original error number, though. Signed-off-by: Eduardo Habkost --- block/qcow2.c |6