From 9175909acc2dc4c3776350798e664d7b0f6cb541 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 11 Dec 2014 19:25:02 +0000 Subject: [PATCH] process.c: move exit parser to a separate file * exit.c: New file. * Makefile.am (strace_SOURCES): Add it. * process.c (sys_exit): Move to exit.c. --- Makefile.am | 1 + exit.c | 16 ++++++++++++++++ process.c | 15 --------------- 3 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 exit.c diff --git a/Makefile.am b/Makefile.am index 3671ce00..d03d90ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,6 +32,7 @@ strace_SOURCES = \ desc.c \ dirent.c \ execve.c \ + exit.c \ fadvise.c \ fallocate.c \ fanotify.c \ diff --git a/exit.c b/exit.c new file mode 100644 index 00000000..0e0c2ea2 --- /dev/null +++ b/exit.c @@ -0,0 +1,16 @@ +#include "defs.h" + +int +sys_exit(struct tcb *tcp) +{ + if (exiting(tcp)) { + fprintf(stderr, "_exit returned!\n"); + return -1; + } + /* special case: we stop tracing this process, finish line now */ + tprintf("%ld) ", tcp->u_arg[0]); + tabto(); + tprints("= ?\n"); + line_ended(); + return 0; +} diff --git a/process.c b/process.c index f3321180..18ac924c 100644 --- a/process.c +++ b/process.c @@ -101,21 +101,6 @@ sys_gethostname(struct tcb *tcp) } #endif -int -sys_exit(struct tcb *tcp) -{ - if (exiting(tcp)) { - fprintf(stderr, "_exit returned!\n"); - return -1; - } - /* special case: we stop tracing this process, finish line now */ - tprintf("%ld) ", tcp->u_arg[0]); - tabto(); - tprints("= ?\n"); - line_ended(); - return 0; -} - #include "xlat/ptrace_cmds.h" #include "xlat/ptrace_setoptions_flags.h" #include "xlat/nt_descriptor_types.h" -- 2.40.0