diff options
Diffstat (limited to 'lib/libc/db/hash/hash_page.c')
-rw-r--r-- | lib/libc/db/hash/hash_page.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index 80d6c0a81eb..0936f6a12e1 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash_page.c,v 1.7 1999/02/15 05:11:24 millert Exp $ */ +/* $OpenBSD: hash_page.c,v 1.8 2002/01/31 03:51:21 millert Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94"; #else -static char rcsid[] = "$OpenBSD: hash_page.c,v 1.7 1999/02/15 05:11:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: hash_page.c,v 1.8 2002/01/31 03:51:21 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -543,8 +543,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap) page = BUCKET_TO_PAGE(bucket); else page = OADDR_TO_PAGE(bucket); - if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) || - ((rsize = read(fd, p, size)) == -1)) + if ((rsize = pread(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1) return (-1); bp = (u_int16_t *)p; if (!rsize) @@ -614,8 +613,7 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap) page = BUCKET_TO_PAGE(bucket); else page = OADDR_TO_PAGE(bucket); - if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) || - ((wsize = write(fd, p, size)) == -1)) + if ((wsize = pwrite(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1) /* Errno is set */ return (-1); if (wsize != size) { |