From: Dmitry V. Levin Date: Sat, 6 Dec 2014 03:53:16 +0000 (+0000) Subject: file.c: move chdir parser to a separate file X-Git-Tag: v4.10~318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b2f674adbd5c44fe892b31cf95703eeceb21c40;p=strace file.c: move chdir parser to a separate file * chdir.c: New file. * Makefile.am (strace_SOURCES): Add it. * file.c (sys_chdir): Move to chdir.c. --- diff --git a/Makefile.am b/Makefile.am index e78e1fe0..f068f7e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,7 @@ strace_SOURCES = \ block.c \ cacheflush.c \ capability.c \ + chdir.c \ chmod.c \ chown.c \ count.c \ diff --git a/chdir.c b/chdir.c new file mode 100644 index 00000000..29f0afc3 --- /dev/null +++ b/chdir.c @@ -0,0 +1,10 @@ +#include "defs.h" + +int +sys_chdir(struct tcb *tcp) +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + } + return 0; +} diff --git a/file.c b/file.c index 7ba68246..8d0822d9 100644 --- a/file.c +++ b/file.c @@ -1241,13 +1241,3 @@ sys_lxstat(struct tcb *tcp) } #endif /* SPARC[64] */ - -/* directory */ -int -sys_chdir(struct tcb *tcp) -{ - if (entering(tcp)) { - printpath(tcp, tcp->u_arg[0]); - } - return 0; -}