-/* $OpenBSD: vfs_syscalls.c,v 1.257 2016/06/26 14:27:14 semarie Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.258 2016/06/27 04:14:38 semarie Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
return (error);
vp = nd.ni_vp;
if (vp->v_type != VCHR || (u_int)major(vp->v_rdev) >= nchrdev ||
- cdevsw[major(vp->v_rdev)].d_type != D_TTY)
- return (ENOTTY);
+ cdevsw[major(vp->v_rdev)].d_type != D_TTY) {
+ error = ENOTTY;
+ goto out;
+ }
if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
goto out;
if (p->p_ucred->cr_uid != vattr.va_uid &&