Explorar o código

Fix qubes.xml unlock code (#748)

Do not call explicit lockf(lOCK_UN) to not unlock the file
buffers are flushed. This is simpler than adding flush() call.
Marek Marczykowski-Górecki %!s(int64=10) %!d(string=hai) anos
pai
achega
e6012a8fd2
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      core/qubes.py

+ 2 - 1
core/qubes.py

@@ -492,7 +492,8 @@ class QubesVmCollection(dict):
         fcntl.lockf (self.qubes_store_file, fcntl.LOCK_EX)
 
     def unlock_db(self):
-        fcntl.lockf (self.qubes_store_file, fcntl.LOCK_UN)
+        # intentionally do not call explicit unlock to not unlock the file
+        # before all buffers are flushed
         self.qubes_store_file.close()
 
     def save(self):