-/*
- * Revoke access the current tty by all processes.
- * Used only by the super-user in init
- * to give ``clean'' terminals at login.
- */
-vhangup()
-{
-
- if (u.u_error = suser(u.u_cred, &u.u_acflag))
- return;
- if (u.u_ttyp == NULL)
- return;
- forceclose(u.u_ttyd);
- if ((u.u_ttyp->t_state) & TS_ISOPEN)
- gsignal(u.u_ttyp->t_pgid, SIGHUP);
- u.u_ttyp->t_session = 0;
- u.u_ttyp->t_pgid = 0;
-}
-
-forceclose(dev)
- dev_t dev;
-{
- register struct file *fp;
- register struct vnode *vp;
-
- for (fp = file; fp < fileNFILE; fp++) {
- if (fp->f_count == 0)
- continue;
- if (fp->f_type != DTYPE_VNODE)
- continue;
- vp = (struct vnode *)fp->f_data;
- if (vp == 0)
- continue;
- if (vp->v_type != VCHR)
- continue;
- if (vp->v_rdev != dev)
- continue;
- fp->f_flag &= ~(FREAD|FWRITE);
- }
-}
-
-/*
- * Vnode release, just decrement the count and call VOP_INACTIVE()
- */
-void vrele(vp)
- register struct vnode *vp;
-{
-
- if (vp == NULL)
- return;
- vp->v_count--;
- if (vp->v_count < 0)
- printf("inode %d, bad ref count %d\n",
- VTOI(vp)->i_number, vp->v_count);
- if (vp->v_count == 0)
- VOP_INACTIVE(vp);
-}
-
-/*
- * vput(), just unlock and vrele()
- */
-vput(vp)
- register struct vnode *vp;
-{
- VOP_UNLOCK(vp);
- vrele(vp);
-}
-