Call _cleanup before _exit
authorceriel <none@none>
Fri, 15 Mar 1991 09:24:03 +0000 (09:24 +0000)
committerceriel <none@none>
Fri, 15 Mar 1991 09:24:03 +0000 (09:24 +0000)
lang/m2/libm2/SYSTEM.c
lang/m2/libm2/catch.c
lang/m2/libm2/halt.c

index b8c8bba..51def55 100644 (file)
@@ -71,6 +71,7 @@ _SYSTEM__NEWPROCESS(p, a, n, p1)
                   Just call the coroutine procedure.
                */
                (*(curproc->proc))();
+               _cleanup();
                _exit(0);
        }
 }
index 909b3f7..cc2b59c 100644 (file)
@@ -52,8 +52,6 @@ static struct errm {
        { -1,           0}
 };
 
-extern                 exit();
-
 catch(trapno)
        int trapno;
 {
@@ -93,11 +91,14 @@ catch(trapno)
                signal(__signo, SIG_DFL);
                _cleanup();
                kill(getpid(), __signo);
-               exit(trapno);
+               _exit(trapno);
        }
 #endif
 #endif
 #endif
-       if (trapno != M2_FORCH) exit(trapno);
+       if (trapno != M2_FORCH) {
+               _cleanup();
+               _exit(trapno);
+       }
        SIG(catch);
 }
index 7b6508a..0c257d0 100644 (file)
@@ -32,5 +32,6 @@ CallAtEnd(p)
 
 halt()
 {
-       exit(0);
+       _cleanup();
+       _exit(0);
 }