exit() now calls _thread_do_exit_notification().
Note, this is incompatible with the BeOS behaviour, which didn't call the hooks when you exit()ed a program. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3109 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c1615a93f0
commit
a8130cded6
@ -23,6 +23,7 @@
|
|||||||
// ToDo: move this puppy to a more standard location
|
// ToDo: move this puppy to a more standard location
|
||||||
#include "../stdio/local.h"
|
#include "../stdio/local.h"
|
||||||
|
|
||||||
|
extern void _thread_do_exit_notification(void);
|
||||||
|
|
||||||
|
|
||||||
static void (*_Exit_Stack[ATEXIT_MAX])(void) = {0};
|
static void (*_Exit_Stack[ATEXIT_MAX])(void) = {0};
|
||||||
@ -54,7 +55,10 @@ atexit(void (*func)(void))
|
|||||||
|
|
||||||
void
|
void
|
||||||
exit(int status)
|
exit(int status)
|
||||||
{
|
{
|
||||||
|
// BeOS on exit notification for the main thread
|
||||||
|
_thread_do_exit_notification();
|
||||||
|
|
||||||
// unwind the exit stack, calling the registered functions
|
// unwind the exit stack, calling the registered functions
|
||||||
while (_Exit_SP > 0)
|
while (_Exit_SP > 0)
|
||||||
(*_Exit_Stack[--_Exit_SP])();
|
(*_Exit_Stack[--_Exit_SP])();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user