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
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
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