diff options
Diffstat (limited to 'lib/libc/db/recno/rec_seq.c')
| -rw-r--r-- | lib/libc/db/recno/rec_seq.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libc/db/recno/rec_seq.c b/lib/libc/db/recno/rec_seq.c index 29210a753697..bc66d1c4987e 100644 --- a/lib/libc/db/recno/rec_seq.c +++ b/lib/libc/db/recno/rec_seq.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)rec_seq.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)rec_seq.c 8.2 (Berkeley) 9/7/93"; #endif /* not lint */ #include <sys/types.h> @@ -69,6 +69,13 @@ __rec_seq(dbp, key, data, flags) int status; 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; + } + switch(flags) { case R_CURSOR: if ((nrec = *(recno_t *)key->data) == 0) @@ -116,7 +123,9 @@ einval: errno = EINVAL; t->bt_rcursor = nrec; status = __rec_ret(t, e, nrec, key, data); - - mpool_put(t->bt_mp, e->page, 0); + if (ISSET(t, B_DB_LOCK)) + mpool_put(t->bt_mp, e->page, 0); + else + t->bt_pinned = e->page; return (status); } |
