[Zope-Checkins] CVS: Zope/lib/python/BTrees - BTreeTemplate.c:1.43 BucketTemplate.c:1.39

Tim Peters tim.one@comcast.net
Mon, 10 Jun 2002 22:59:05 -0400


Update of /cvs-repository/Zope/lib/python/BTrees
In directory cvs.zope.org:/tmp/cvs-serv10309

Modified Files:
	BTreeTemplate.c BucketTemplate.c 
Log Message:
Changed the uses of PER_CHANGED() that weren't checking the result for
an error return.


=== Zope/lib/python/BTrees/BTreeTemplate.c 1.42 => 1.43 ===
     }
 
-  PER_CHANGED(self);
+  if (PER_CHANGED(self) < 0)
+    return -1;
   return 0;
 }
 


=== Zope/lib/python/BTrees/BucketTemplate.c 1.38 => 1.39 ===
   self->next = next;
 
-  PER_CHANGED(self);
+  if (PER_CHANGED(self) < 0)
+    return -1;
 
   return 0;
 }
@@ -459,21 +460,23 @@
 static int
 Bucket_deleteNextBucket(Bucket *self)
 {
+  int result = -1;      /* until proven innocent */
+
   PER_USE_OR_RETURN(self, -1);
   if (self->next)
     {
       Bucket *n;
-      if (Bucket_nextBucket(self->next, &n) < 0) goto err;
+      if (Bucket_nextBucket(self->next, &n) < 0) goto Done;
       ASSIGNB(self->next, n);
-      PER_CHANGED(self);
+      if (PER_CHANGED(self) < 0)
+        goto Done;
     }
+  result = 0;
+
+Done:
   PER_ALLOW_DEACTIVATION(self);
   PER_ACCESSED(self);
-  return 0;
- err:
-  PER_ALLOW_DEACTIVATION(self);
-  PER_ACCESSED(self);
-  return -1;
+  return result;
 }
 
 /*