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
2 changed files with 12 additions and 12 deletions
sys

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.