aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/db/btree/bt_close.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/db/btree/bt_close.c')
-rw-r--r--lib/libc/db/btree/bt_close.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c
index 22c739b7b78b..5ff2adff9c8f 100644
--- a/lib/libc/db/btree/bt_close.c
+++ b/lib/libc/db/btree/bt_close.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_close.c 8.1 (Berkeley) 6/4/93";
+static char sccsid[] = "@(#)bt_close.c 8.2 (Berkeley) 9/7/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -69,6 +69,12 @@ __bt_close(dbp)
t = dbp->internal;
+ /* Toss any page pinned across calls. */
+ if (t->bt_pinned != NULL) {
+ mpool_put(t->bt_mp, t->bt_pinned, 0);
+ t->bt_pinned = NULL;
+ }
+
/*
* Delete any already deleted record that we've been saving
* because the cursor pointed to it.
@@ -114,13 +120,20 @@ __bt_sync(dbp, flags)
PAGE *h;
void *p;
+ t = dbp->internal;
+
+ /* Toss any page pinned across calls. */
+ if (t->bt_pinned != NULL) {
+ mpool_put(t->bt_mp, t->bt_pinned, 0);
+ t->bt_pinned = NULL;
+ }
+
+ /* Sync doesn't currently take any flags. */
if (flags != 0) {
errno = EINVAL;
return (RET_ERROR);
}
- t = dbp->internal;
-
if (ISSET(t, B_INMEM | B_RDONLY) || !ISSET(t, B_MODIFIED))
return (RET_SUCCESS);