From a8130cded607b93a4aa0fe1618e4be4232e80713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 28 Apr 2003 11:11:26 +0000 Subject: [PATCH] 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 --- src/kernel/libroot/posix/stdlib/exit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/libroot/posix/stdlib/exit.c b/src/kernel/libroot/posix/stdlib/exit.c index 1264406755..d6eb2b06ec 100644 --- a/src/kernel/libroot/posix/stdlib/exit.c +++ b/src/kernel/libroot/posix/stdlib/exit.c @@ -23,6 +23,7 @@ // ToDo: move this puppy to a more standard location #include "../stdio/local.h" +extern void _thread_do_exit_notification(void); static void (*_Exit_Stack[ATEXIT_MAX])(void) = {0}; @@ -54,7 +55,10 @@ atexit(void (*func)(void)) void exit(int status) -{ +{ + // BeOS on exit notification for the main thread + _thread_do_exit_notification(); + // unwind the exit stack, calling the registered functions while (_Exit_SP > 0) (*_Exit_Stack[--_Exit_SP])();