Fix errno return values to better represent failure reasons for

read and open.

Approved by:	schweikh (mentor)
Agreed:		bde
MFC after:	6 weeks
This commit is contained in:
Diomidis Spinellis 2003-09-02 16:46:31 +00:00
parent a3d52360e2
commit 5a5f2134b8

View File

@ -438,7 +438,7 @@ nfs_open(struct vop_open_args *ap)
#ifdef DIAGNOSTIC
printf("open eacces vtyp=%d\n", vp->v_type);
#endif
return (EACCES);
return (EOPNOTSUPP);
}
/*
* Get a valid lease. If cached data is stale, flush it.
@ -956,9 +956,14 @@ nfs_read(struct vop_read_args *ap)
{
struct vnode *vp = ap->a_vp;
if (vp->v_type != VREG)
return (EPERM);
return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred));
switch (vp->v_type) {
case VREG:
return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred));
case VDIR:
return EISDIR;
default:
return EOPNOTSUPP;
}
}
/*