summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lockf.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-23 16:00:27 +0000
committerache <ache@FreeBSD.org>2001-08-23 16:00:27 +0000
commit82c8a757faf9c36623540e26c6376417a3a8514a (patch)
tree85604a33ff709c1ad0292dbd92647235de92f3b6 /sys/kern/kern_lockf.c
parente932bf8680ea1222e52e9735936fb6a75762d5a9 (diff)
downloadFreeBSD-src-82c8a757faf9c36623540e26c6376417a3a8514a.zip
FreeBSD-src-82c8a757faf9c36623540e26c6376417a3a8514a.tar.gz
Oops, fix my broken handling of new l_len<0 case
Diffstat (limited to 'sys/kern/kern_lockf.c')
-rw-r--r--sys/kern/kern_lockf.c6
1 files changed, 4 insertions, 2 deletions
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 {
OpenPOWER on IntegriCloud