diff options
Diffstat (limited to 'lib/libc/db/recno/rec_close.c')
| -rw-r--r-- | lib/libc/db/recno/rec_close.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/libc/db/recno/rec_close.c b/lib/libc/db/recno/rec_close.c index 49c5f2ca5e56..73e3690394ba 100644 --- a/lib/libc/db/recno/rec_close.c +++ b/lib/libc/db/recno/rec_close.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)rec_close.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)rec_close.c 8.2 (Berkeley) 9/7/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -63,12 +63,18 @@ __rec_close(dbp) BTREE *t; int rval; + 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; + } + if (__rec_sync(dbp, 0) == RET_ERROR) return (RET_ERROR); /* Committed to closing. */ - t = dbp->internal; - rval = RET_SUCCESS; if (ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize)) rval = RET_ERROR; @@ -110,6 +116,12 @@ __rec_sync(dbp, flags) 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; + } + if (flags == R_RECNOSYNC) return (__bt_sync(dbp, 0)); |
