aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2018-06-22 17:09:10 +0100
committerAlex Bennée <alex.bennee@linaro.org>2018-07-05 15:59:41 +0100
commit708b6a643c7a974ffadf64e00019bdcd60edf6e5 (patch)
treed731b8484b605bb19dcdf47f6eb85cdee0794bf2 /linux-user/syscall.c
parentfe8bf5f62972ce9f227ae3e25767116a6d221b6d (diff)
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.c10
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