From cbb9288e9f7d392e2c466cc1f1cae000f8efb96c Mon Sep 17 00:00:00 2001 From: kleink Date: Sun, 24 Aug 1997 16:13:28 +0000 Subject: [PATCH] Lseek(2) returns -1 on failure, so checking for "n < -1" is not appropriate. --- lib/libc/db/mpool/mpool.libtp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/db/mpool/mpool.libtp b/lib/libc/db/mpool/mpool.libtp index 665f03b7ada6..505968f76156 100644 --- a/lib/libc/db/mpool/mpool.libtp +++ b/lib/libc/db/mpool/mpool.libtp @@ -1,6 +1,6 @@ /****************************************************************************** -VERSION $NetBSD: mpool.libtp,v 1.2 1997/01/13 20:31:18 tls Exp $ +VERSION $NetBSD: mpool.libtp,v 1.3 1997/08/24 16:13:28 kleink Exp $ PACKAGE: User Level Shared Memory Manager DESCRIPTION: @@ -578,7 +578,7 @@ BUFHDR_T *bhp; int nbytes; assert ( (bhp-bufhdr_table) < NUM_BUFS ); - if ( lseek ( fd, bhp->id.obj_id << BUFSHIFT, L_SET ) < 0 ) { + if ( lseek ( fd, (off_t)(bhp->id.obj_id << BUFSHIFT), L_SET ) < 0 ) { return(-1); } bhp->flags |= BUF_IO_IN_PROGRESS; @@ -646,7 +646,7 @@ int *len; /* Number of bytes read */ if (RELEASE_MASTER) { return(NULL); } - if ( lseek ( fd, obj->obj_id << BUFSHIFT, L_SET ) < -1 ) { + if ( lseek ( fd, (off_t)(obj->obj_id << BUFSHIFT), L_SET ) < 0 ) { error_log2 ("Unable to perform seek on file: %d to page %d", obj->file_id, obj->obj_id ); bhp->flags &= ~BUF_IO_IN_PROGRESS;