Call _cleanup before _exit

This commit is contained in:
ceriel 1991-03-15 09:24:03 +00:00
parent adab058c34
commit f4691c73c4
3 changed files with 8 additions and 5 deletions

View file

@ -71,6 +71,7 @@ _SYSTEM__NEWPROCESS(p, a, n, p1)
Just call the coroutine procedure. Just call the coroutine procedure.
*/ */
(*(curproc->proc))(); (*(curproc->proc))();
_cleanup();
_exit(0); _exit(0);
} }
} }

View file

@ -52,8 +52,6 @@ static struct errm {
{ -1, 0} { -1, 0}
}; };
extern exit();
catch(trapno) catch(trapno)
int trapno; int trapno;
{ {
@ -93,11 +91,14 @@ catch(trapno)
signal(__signo, SIG_DFL); signal(__signo, SIG_DFL);
_cleanup(); _cleanup();
kill(getpid(), __signo); kill(getpid(), __signo);
exit(trapno); _exit(trapno);
} }
#endif #endif
#endif #endif
#endif #endif
if (trapno != M2_FORCH) exit(trapno); if (trapno != M2_FORCH) {
_cleanup();
_exit(trapno);
}
SIG(catch); SIG(catch);
} }

View file

@ -32,5 +32,6 @@ CallAtEnd(p)
halt() halt()
{ {
exit(0); _cleanup();
_exit(0);
} }