add BTF_EOF to test instead of bt_reof
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 Mar 1993 06:48:55 +0000 (22:48 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 Mar 1993 06:48:55 +0000 (22:48 -0800)
clean up mmap and file pointer uses in recno interface

SCCS-vsn: lib/libc/db/recno/rec_seq.c 5.8

usr/src/lib/libc/db/recno/rec_seq.c

index 33c583c..a6175ce 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)rec_seq.c  5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)rec_seq.c  5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -65,7 +65,7 @@ __rec_seq(dbp, key, data, flags)
                }
                /* FALLTHROUGH */
        case R_LAST:
                }
                /* FALLTHROUGH */
        case R_LAST:
-               if (!ISSET(t, BTF_RINMEM) &&
+               if (!ISSET(t, BTF_EOF | BTF_RINMEM) &&
                    t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
                        return (RET_ERROR);
                nrec = t->bt_nrecs;
                    t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
                        return (RET_ERROR);
                nrec = t->bt_nrecs;
@@ -76,7 +76,7 @@ einval:               errno = EINVAL;
        }
        
        if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) {
        }
        
        if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) {
-               if (!ISSET(t, BTF_RINMEM) &&
+               if (!ISSET(t, BTF_EOF | BTF_RINMEM) &&
                    (status = t->bt_irec(t, nrec)) != RET_SUCCESS)
                        return (status);
                if (t->bt_nrecs == 0 || nrec > t->bt_nrecs)
                    (status = t->bt_irec(t, nrec)) != RET_SUCCESS)
                        return (status);
                if (t->bt_nrecs == 0 || nrec > t->bt_nrecs)