Oops, fix my broken handling of new l_len<0 case

This commit is contained in:
Andrey A. Chernov 2001-08-23 16:00:27 +00:00
parent e3e2c03de3
commit 62be011ebd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82202

View File

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