[xiph-cvs] cvs commit: positron/positron/db MDB.py

Stan Seibert volsung at xiph.org
Thu Mar 11 20:45:49 PST 2004



volsung     04/03/11 23:45:49

  Modified:    positron/db MDB.py
  Log:
  Patch to properly flag database updates.  Closes bug 469.

Revision  Changes    Path
1.5       +2 -2      positron/positron/db/MDB.py

Index: MDB.py
===================================================================
RCS file: /usr/local/cvsroot/positron/positron/db/MDB.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- a/MDB.py	25 Oct 2003 15:18:57 -0000	1.4
+++ b/MDB.py	12 Mar 2004 04:45:49 -0000	1.5
@@ -381,7 +381,7 @@
         
         header["isRoot"] = (header["Attributes"] & 0x01) == 0x01
         header["isRemovableChildDB"] = (header["Attributes"] & 0x02) == 0x02
-        header["isModified"] = (header["Status"] & 0x01) == 0x01
+        header["isModified"] = (header["Status"] & 0x02) == 0x00
 
         # Read pointers
         pattern = ">II" + "II"*header["NumOfKeys"]
@@ -427,7 +427,7 @@
         # save disk access.
         if self.header["isModified"] != new_state:
             # Flip status bit
-            self.header["Status"] = self.header["Status"] ^ 0x01
+            self.header["Status"] = self.header["Status"] & ~0x02
             self.header["isModified"] = new_state
             # Write it to disk
             status_word = struct.pack(">H", self.header["Status"])

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list