fix bug that can cause recursive .forward files to fail
[unix-history] / usr / src / sys / kern / kern_exit.c
index 19abf4d..7aa1695 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1989, 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_exit.c 8.1 (Berkeley) %G%
+ *     @(#)kern_exit.c 8.2 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -34,6 +34,9 @@
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
 
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
 
+__dead void cpu_exit __P((struct proc *));
+__dead void exit1 __P((struct proc *, int));
+
 /*
  * exit --
  *     Death of process.
 /*
  * exit --
  *     Death of process.
@@ -41,6 +44,7 @@
 struct rexit_args {
        int     rval;
 };
 struct rexit_args {
        int     rval;
 };
+__dead void
 exit(p, uap, retval)
        struct proc *p;
        struct rexit_args *uap;
 exit(p, uap, retval)
        struct proc *p;
        struct rexit_args *uap;
@@ -56,6 +60,7 @@ exit(p, uap, retval)
  * to zombie, and unlink proc from allproc and parent's lists.  Save exit
  * status and rusage for wait().  Check for child processes and orphan them.
  */
  * to zombie, and unlink proc from allproc and parent's lists.  Save exit
  * status and rusage for wait().  Check for child processes and orphan them.
  */
+__dead void
 exit1(p, rv)
        register struct proc *p;
        int rv;
 exit1(p, rv)
        register struct proc *p;
        int rv;
@@ -137,7 +142,7 @@ exit1(p, rv)
        }
        fixjobc(p, p->p_pgrp, 0);
        p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
        }
        fixjobc(p, p->p_pgrp, 0);
        p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
-       (void) acct(p);
+       (void)acct_process(p);
 #ifdef KTRACE
        /* 
         * release trace file
 #ifdef KTRACE
        /* 
         * release trace file
@@ -232,7 +237,6 @@ done:
         * our execution (pun intended).
         */
        cpu_exit(p);
         * our execution (pun intended).
         */
        cpu_exit(p);
-       /* NOTREACHED */
 }
 
 struct wait_args {
 }
 
 struct wait_args {
@@ -290,11 +294,7 @@ wait4(p, uap, retval)
 #define        wait1   wait4
 #endif
 
 #define        wait1   wait4
 #endif
 
-/*
- * Wait: check child processes to see if any have exited,
- * stopped under trace, or (optionally) stopped by a signal.
- * Pass back status and deallocate exited child's proc structure.
- */
+int
 wait1(q, uap, retval)
        register struct proc *q;
        register struct wait_args *uap;
 wait1(q, uap, retval)
        register struct proc *q;
        register struct wait_args *uap;