case SEEK_END: first = f->filp_vno->v_size; break;
default: return(EINVAL);
}
+
/* Check for overflow. */
if (((long)flock.l_start > 0) && ((first + flock.l_start) < first))
return(EINVAL);
/* Check if this region conflicts with any existing lock. */
empty = NIL_LOCK;
- for (flp = &file_lock[0]; flp < & file_lock[NR_LOCKS]; flp++) {
+ for (flp = &file_lock[0]; flp < &file_lock[NR_LOCKS]; flp++) {
if (flp->lock_type == 0) {
if (empty == NIL_LOCK) empty = flp;
continue; /* 0 means unused slot */
if (ltype == F_UNLCK) return(OK); /* unlocked a region with no locks */
/* There is no conflict. If space exists, store new lock in the table. */
- if (empty == (struct file_lock *) 0) return(ENOLCK); /* table full */
+ if (empty == NIL_LOCK) return(ENOLCK); /* table full */
empty->lock_type = ltype;
empty->lock_pid = fp->fp_pid;
empty->lock_vnode = f->filp_vno;
struct fproc *fptr;
- for (fptr = &fproc[INIT_PROC_NR + 1]; fptr < &fproc[NR_PROCS]; fptr++){
+ for (fptr = &fproc[0]; fptr < &fproc[NR_PROCS]; fptr++){
if(fptr->fp_pid == PID_FREE) continue;
if (fptr->fp_blocked_on == FP_BLOCKED_ON_LOCK) {
revive(fptr->fp_endpoint, 0);