We need to let the runtime loader call shared object termination hooks
from exit(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27991 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -46,6 +46,8 @@ struct rld_export {
|
|||||||
|
|
||||||
void (*call_atexit_hooks_for_range)(addr_t start, addr_t size);
|
void (*call_atexit_hooks_for_range)(addr_t start, addr_t size);
|
||||||
|
|
||||||
|
void (*call_termination_hooks)();
|
||||||
|
|
||||||
const struct user_space_program_args *program_args;
|
const struct user_space_program_args *program_args;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <syscalls.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <limits.h>
|
|
||||||
#include <SupportDefs.h>
|
#include <syscalls.h>
|
||||||
|
#include <user_runtime.h>
|
||||||
|
|
||||||
|
|
||||||
extern void _IO_cleanup(void);
|
extern void _IO_cleanup(void);
|
||||||
@@ -144,6 +147,8 @@ exit(int status)
|
|||||||
// close all open files
|
// close all open files
|
||||||
_IO_cleanup();
|
_IO_cleanup();
|
||||||
|
|
||||||
|
__gRuntimeLoader->call_termination_hooks();
|
||||||
|
|
||||||
// exit with status code
|
// exit with status code
|
||||||
_kern_exit_team(status);
|
_kern_exit_team(status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ struct rld_export gRuntimeLoader = {
|
|||||||
get_next_image_dependency,
|
get_next_image_dependency,
|
||||||
|
|
||||||
elf_reinit_after_fork,
|
elf_reinit_after_fork,
|
||||||
NULL // call_atexit_hooks_for_range
|
NULL, // call_atexit_hooks_for_range
|
||||||
|
terminate_program
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user