summaryrefslogtreecommitdiff
path: root/sys/kern/kern_lockf.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-08-23 16:00:27 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-08-23 16:00:27 +0000
commit62be011ebd0374fa9a01e04aeecf31976a4f7414 (patch)
tree85604a33ff709c1ad0292dbd92647235de92f3b6 /sys/kern/kern_lockf.c
parente3e2c03de3df2edbc6adbdc221c96a10b9c02263 (diff)
Notes
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 7e11d653b239..de8c75daeef6 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 {