summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_vnops.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 2e5f64e3b86..f175bbc7284 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.111 2020/01/05 13:46:02 visa Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.112 2020/02/16 19:34:59 anton Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -508,7 +508,7 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p)
{
struct vnode *vp = fp->f_data;
struct vattr vattr;
- int error;
+ int error = ENOTTY;
switch (vp->v_type) {
@@ -517,15 +517,12 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p)
if (com == FIONREAD) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
- return (error);
+ break;
*(int *)data = vattr.va_size - foffset(fp);
- return (0);
- }
- if (com == FIONBIO || com == FIOASYNC) /* XXX */
- return (0); /* XXX */
- /* FALLTHROUGH */
- default:
- return (ENOTTY);
+
+ } else if (com == FIONBIO || com == FIOASYNC) /* XXX */
+ error = 0; /* XXX */
+ break;
case VFIFO:
case VCHR:
@@ -539,8 +536,13 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p)
if (ovp)
vrele(ovp);
}
- return (error);
+ break;
+
+ default:
+ break;
}
+
+ return (error);
}
/*