Browse Source

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 10 years ago
parent
commit
e6012a8fd2
1 changed files with 2 additions and 1 deletions
  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):