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.47 (requested by christos):



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

description:
Pull up revision 1.47 (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/kern_proc.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r a2a1db7581cb -r d5833a8f3aa2 sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c      Fri Apr 26 17:56:24 2002 +0000
+++ b/sys/kern/kern_proc.c      Fri Apr 26 17:56:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_proc.c,v 1.41.4.1 2001/07/29 19:37:27 he Exp $    */
+/*     $NetBSD: kern_proc.c,v 1.41.4.2 2002/04/26 17:56:40 he Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -392,8 +392,8 @@
                                panic("enterpgrp: mksession and p != curproc");
 #endif
                } else {
+                       SESSHOLD(p->p_session);
                        pgrp->pg_session = p->p_session;
-                       pgrp->pg_session->s_count++;
                }
                pgrp->pg_id = pgid;
                LIST_INIT(&pgrp->pg_members);
@@ -446,12 +446,7 @@
            pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
                pgrp->pg_session->s_ttyp->t_pgrp = NULL;
        LIST_REMOVE(pgrp, pg_hash);
-       if (--pgrp->pg_session->s_count == 0) {
-               /* Remove reference (if any) from tty to this session */
-               if (pgrp->pg_session->s_ttyp != NULL)
-                       pgrp->pg_session->s_ttyp->t_session = NULL;
-               FREE(pgrp->pg_session, M_SESSION);
-       }
+       SESSRELE(pgrp->pg_session);
        pool_put(&pgrp_pool, pgrp);
 }
 



Home | Main Index | Thread Index | Old Index