diff options
author | Alex Bennée | 2018-06-22 18:09:10 +0200 |
---|---|---|
committer | Alex Bennée | 2018-07-05 16:59:41 +0200 |
commit | 708b6a643c7a974ffadf64e00019bdcd60edf6e5 (patch) | |
tree | d731b8484b605bb19dcdf47f6eb85cdee0794bf2 /linux-user/syscall.c | |
parent | build-system: add coverage-report target (diff) | |
download | qemu-708b6a643c7a974ffadf64e00019bdcd60edf6e5.tar.gz qemu-708b6a643c7a974ffadf64e00019bdcd60edf6e5.tar.xz qemu-708b6a643c7a974ffadf64e00019bdcd60edf6e5.zip |
linux-user: introduce preexit_cleanup
To avoid repeating ourselves move our preexit clean-up code into a
helper function. I figured the continuing effort to split of the
syscalls made it worthwhile creating a new file for it now.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 50e20fb659..5822e03e28 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8022,10 +8022,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } cpu_list_unlock(); -#ifdef TARGET_GPROF - _mcleanup(); -#endif - gdb_exit(cpu_env, arg1); + preexit_cleanup(cpu_env, arg1); _exit(arg1); ret = 0; /* avoid warning */ break; @@ -10131,10 +10128,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef __NR_exit_group /* new thread calls */ case TARGET_NR_exit_group: -#ifdef TARGET_GPROF - _mcleanup(); -#endif - gdb_exit(cpu_env, arg1); + preexit_cleanup(cpu_env, arg1); ret = get_errno(exit_group(arg1)); break; #endif |