]> granicus.if.org Git - strace/commitdiff
process.c: move exit parser to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 22:52:03 +0000 (22:52 +0000)
* exit.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_exit): Move to exit.c.

Makefile.am
exit.c [new file with mode: 0644]
process.c

index 3671ce001b90acacb2d2c3b56464b75772abfd32..d03d90ca14cb29d5cf4b4c6094b50607fc880ad6 100644 (file)
@@ -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 (file)
index 0000000..0e0c2ea
--- /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;
+}
index f3321180149748f24c4b7b9990999e0e63fe722a..18ac924c786846703ca781ee303baecc481f65b6 100644 (file)
--- 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"