From a836430dbbe1a87b7aefca9b701e19b88b8ed446 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 6 Dec 2014 03:53:16 +0000 Subject: [PATCH] file.c: move getcwd parser to a separate file * getcwd.c: New file. * Makefile.am (strace_SOURCES): Add it. * file.c (sys_getcwd): Move to getcwd.c. --- Makefile.am | 1 + file.c | 13 ------------- getcwd.c | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 getcwd.c diff --git a/Makefile.am b/Makefile.am index 54d12051..f7e477a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,6 +29,7 @@ strace_SOURCES = \ fallocate.c \ fanotify.c \ file.c \ + getcwd.c \ inotify.c \ io.c \ ioctl.c \ diff --git a/file.c b/file.c index 48212ec7..f13f613b 100644 --- a/file.c +++ b/file.c @@ -1668,16 +1668,3 @@ sys_mknodat(struct tcb *tcp) print_dirfd(tcp, tcp->u_arg[0]); return decode_mknod(tcp, 1); } - -int -sys_getcwd(struct tcb *tcp) -{ - if (exiting(tcp)) { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); - else - printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1); - tprintf(", %lu", tcp->u_arg[1]); - } - return 0; -} diff --git a/getcwd.c b/getcwd.c new file mode 100644 index 00000000..1b974485 --- /dev/null +++ b/getcwd.c @@ -0,0 +1,14 @@ +#include "defs.h" + +int +sys_getcwd(struct tcb *tcp) +{ + if (exiting(tcp)) { + if (syserror(tcp)) + tprintf("%#lx", tcp->u_arg[0]); + else + printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1); + tprintf(", %lu", tcp->u_arg[1]); + } + return 0; +}