Lseek(2) returns -1 on failure, so checking for "n < -1" is not appropriate.

This commit is contained in:
kleink 1997-08-24 16:13:28 +00:00
parent a8f17a8bdb
commit cbb9288e9f

View File

@ -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;