Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/kern Pull up revision 1.136 (requested by christos):



details:   https://anonhg.NetBSD.org/src/rev/a2a1db7581cb
branches:  netbsd-1-5
changeset: 493092:a2a1db7581cb
user:      he <he%NetBSD.org@localhost>
date:      Fri Apr 26 17:56:24 2002 +0000

description:
Pull up revision 1.136 (requested by christos):
  Use SESSHOLD and SESSRELE consistently, and add them to t_session,
  so that we do not have dangling references.

diffstat:

 sys/kern/tty.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 5e5524dcd627 -r a2a1db7581cb sys/kern/tty.c
--- a/sys/kern/tty.c    Fri Apr 26 17:52:15 2002 +0000
+++ b/sys/kern/tty.c    Fri Apr 26 17:56:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.119 2000/05/26 00:36:52 thorpej Exp $        */
+/*     $NetBSD: tty.c,v 1.119.4.1 2002/04/26 17:56:24 he Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1991, 1993
@@ -267,7 +267,10 @@
 
        tp->t_gen++;
        tp->t_pgrp = NULL;
-       tp->t_session = NULL;
+       if (tp->t_session != NULL) {
+               SESSRELE(tp->t_session);
+               tp->t_session = NULL;
+       }
        tp->t_state = 0;
        return (0);
 }
@@ -979,6 +982,7 @@
                    ((p->p_session->s_ttyvp || tp->t_session) &&
                     (tp->t_session != p->p_session)))
                        return (EPERM);
+               SESSHOLD(p->p_session);
                tp->t_session = p->p_session;
                tp->t_pgrp = p->p_pgrp;
                p->p_session->s_ttyp = tp;



Home | Main Index | Thread Index | Old Index