[PATCH] Close file descriptors when an error occurs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 storage/formats/__init__.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index 784bb1c..e68684c 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -258,8 +258,10 @@ class DeviceFormat(object):
                 pass
             else:
                 log.error("error zeroing out %s: %s" % (self.device, e))
+            os.close(fd)
         except Exception as e:
             log.error("error zeroing out %s: %s" % (self.device, e))
+            os.close(fd)
 
         self.exists = False
 
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux