]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
io: Don't call close multiple times in QIOChannelFile
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 1 Nov 2017 14:25:25 +0000 (14:25 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 15 Feb 2018 16:54:57 +0000 (16:54 +0000)
If the file descriptor underlying QIOChannelFile is closed in the
io_close() method, don't close it again in the finalize() method since
the file descriptor number may have been reused in the meantime.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
io/channel-file.c

index 16bf7ed270f8c42fb12115fb52da5267b88b852b..1f2f710bf96d3d66271767c96a85aa938ecabf2f 100644 (file)
@@ -178,6 +178,7 @@ static int qio_channel_file_close(QIOChannel *ioc,
                          "Unable to close file");
         return -1;
     }
+    fioc->fd = -1;
     return 0;
 }