Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 2015 18:53:57 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285214 - head/sys/kern
Message-ID:  <201507061853.t66Irvi4030281@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Mon Jul  6 18:53:56 2015
New Revision: 285214
URL: https://svnweb.freebsd.org/changeset/base/285214

Log:
  tty: replace several curthread->td_proc with stored curproc
  
  No functional changes.

Modified:
  head/sys/kern/tty_tty.c

Modified: head/sys/kern/tty_tty.c
==============================================================================
--- head/sys/kern/tty_tty.c	Mon Jul  6 18:27:41 2015	(r285213)
+++ head/sys/kern/tty_tty.c	Mon Jul  6 18:53:56 2015	(r285214)
@@ -58,25 +58,27 @@ static void
 ctty_clone(void *arg, struct ucred *cred, char *name, int namelen,
     struct cdev **dev)
 {
+	struct proc *p;
 
 	if (*dev != NULL)
 		return;
 	if (strcmp(name, "tty"))
 		return;
+	p = curproc;
 	sx_sunlock(&clone_drain_lock);
 	sx_slock(&proctree_lock);
 	sx_slock(&clone_drain_lock);
 	dev_lock();
-	if (!(curthread->td_proc->p_flag & P_CONTROLT))
+	if (!(p->p_flag & P_CONTROLT))
 		*dev = ctty;
-	else if (curthread->td_proc->p_session->s_ttyvp == NULL)
+	else if (p->p_session->s_ttyvp == NULL)
 		*dev = ctty;
-	else if (curthread->td_proc->p_session->s_ttyvp->v_type == VBAD ||
-	    curthread->td_proc->p_session->s_ttyvp->v_rdev == NULL) {
+	else if (p->p_session->s_ttyvp->v_type == VBAD ||
+	    p->p_session->s_ttyvp->v_rdev == NULL) {
 		/* e.g. s_ttyvp was revoked */
 		*dev = ctty;
 	} else
-		*dev = curthread->td_proc->p_session->s_ttyvp->v_rdev;
+		*dev = p->p_session->s_ttyvp->v_rdev;
 	dev_refl(*dev);
 	dev_unlock();
 	sx_sunlock(&proctree_lock);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507061853.t66Irvi4030281>