diff options
author | ache <ache@FreeBSD.org> | 2001-08-23 14:21:26 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-08-23 14:21:26 +0000 |
commit | 34f1fd94b4a293b8572295aa2dc4e1facae0ec62 (patch) | |
tree | a1083cc57618751b37927051e9a6badf462bc899 | |
parent | aafa17c550a577937c77ffc95f0a8fea9cf5c8cb (diff) | |
download | FreeBSD-src-34f1fd94b4a293b8572295aa2dc4e1facae0ec62.zip FreeBSD-src-34f1fd94b4a293b8572295aa2dc4e1facae0ec62.tar.gz |
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
-rw-r--r-- | sys/nfs/nfs_lock.c | 12 | ||||
-rw-r--r-- | sys/nfsclient/nfs_lock.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/nfs/nfs_lock.c b/sys/nfs/nfs_lock.c index 4e670f2..ac52410 100644 --- a/sys/nfs/nfs_lock.c +++ b/sys/nfs/nfs_lock.c @@ -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. diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c index 4e670f2..ac52410 100644 --- a/sys/nfsclient/nfs_lock.c +++ b/sys/nfsclient/nfs_lock.c @@ -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. |