From 82c8a757faf9c36623540e26c6376417a3a8514a Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 23 Aug 2001 16:00:27 +0000 Subject: Oops, fix my broken handling of new l_len<0 case --- sys/kern/kern_lockf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_lockf.c') diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index 7e11d65..de8c75d 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -133,10 +133,12 @@ lf_advlock(ap, head, size) if (start < 0) return (EINVAL); if (fl->l_len < 0) { - start += fl->l_len; - if (start <= 0) + if (start == 0) return (EINVAL); end = start - 1; + start += fl->l_len; + if (start < 0) + return (EINVAL); } else if (fl->l_len == 0) end = -1; else { -- cgit v1.1