Even better move: suppose that server is able to handle SEEK_END,

so check arguments for all but not SEEK_END case, leaving SEEK_END
handling for server
This commit is contained in:
Andrey A. Chernov 2001-08-23 14:21:26 +00:00
parent e018907ed4
commit 6c3f4fef64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82194
2 changed files with 12 additions and 12 deletions

View file

@ -104,12 +104,12 @@ nfs_dolock(ap)
*/
if (fl->l_len < 0)
return (EINVAL);
if (fl->l_whence == SEEK_END)
return (EOPNOTSUPP);
if (fl->l_start < 0)
return (EINVAL);
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
return (EOVERFLOW);
if (fl->l_whence != SEEK_END) {
if (fl->l_start < 0)
return (EINVAL);
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
return (EOVERFLOW);
}
/*
* Fill in the information structure.

View file

@ -104,12 +104,12 @@ nfs_dolock(ap)
*/
if (fl->l_len < 0)
return (EINVAL);
if (fl->l_whence == SEEK_END)
return (EOPNOTSUPP);
if (fl->l_start < 0)
return (EINVAL);
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
return (EOVERFLOW);
if (fl->l_whence != SEEK_END) {
if (fl->l_start < 0)
return (EINVAL);
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
return (EOVERFLOW);
}
/*
* Fill in the information structure.