[Libguestfs] [PATCH 2/3] builder: pxzcat: Close the output file.

Richard W.M. Jones rjones at redhat.com
Thu Apr 14 15:20:21 UTC 2016


After uncompressing the template we didn't close the output file,
which potentially could cause writes to the output file to be lost.
---
 builder/pxzcat-c.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/builder/pxzcat-c.c b/builder/pxzcat-c.c
index ae9a060..ce0516c 100644
--- a/builder/pxzcat-c.c
+++ b/builder/pxzcat-c.c
@@ -227,6 +227,9 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads)
 
   if (close (fd) == -1)
     unix_error (errno, (char *) "close", filenamev);
+
+  if (close (ofd) == -1)
+    unix_error (errno, (char *) "close", outputfilev);
 }
 
 static int
-- 
2.7.4




More information about the Libguestfs mailing list