file.c: move chown, fchown, and fchownat parsers to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 6 Dec 2014 03:53:16 +0000 (03:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 21:39:28 +0000 (21:39 +0000)
* chown.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c.

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

index 664475e78cdf3b231142ff812f99180830ad5e7e..e4b78521601f3d83fbd9d8bd29193bd2d5e818b6 100644 (file)
@@ -23,6 +23,7 @@ strace_SOURCES =      \
        cacheflush.c    \
        capability.c    \
        chmod.c         \
+       chown.c         \
        count.c         \
        desc.c          \
        dirent.c        \
diff --git a/chown.c b/chown.c
new file mode 100644 (file)
index 0000000..6914a48
--- /dev/null
+++ b/chown.c
@@ -0,0 +1,37 @@
+#include "defs.h"
+
+int
+sys_chown(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               printpath(tcp, tcp->u_arg[0]);
+               printuid(", ", tcp->u_arg[1]);
+               printuid(", ", tcp->u_arg[2]);
+       }
+       return 0;
+}
+
+int
+sys_fchownat(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               print_dirfd(tcp, tcp->u_arg[0]);
+               printpath(tcp, tcp->u_arg[1]);
+               printuid(", ", tcp->u_arg[2]);
+               printuid(", ", tcp->u_arg[3]);
+               tprints(", ");
+               printflags(at_flags, tcp->u_arg[4], "AT_???");
+       }
+       return 0;
+}
+
+int
+sys_fchown(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               printfd(tcp, tcp->u_arg[0]);
+               printuid(", ", tcp->u_arg[1]);
+               printuid(", ", tcp->u_arg[2]);
+       }
+       return 0;
+}
diff --git a/file.c b/file.c
index dabd729823264ac5464d3ee728b2bff9752fcfd7..e66fdfc0c7b184cceb6f521a47d93c037b0cab4c 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1388,39 +1388,3 @@ sys_renameat2(struct tcb *tcp)
        }
        return 0;
 }
-
-int
-sys_chown(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[0]);
-               printuid(", ", tcp->u_arg[1]);
-               printuid(", ", tcp->u_arg[2]);
-       }
-       return 0;
-}
-
-int
-sys_fchownat(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               print_dirfd(tcp, tcp->u_arg[0]);
-               printpath(tcp, tcp->u_arg[1]);
-               printuid(", ", tcp->u_arg[2]);
-               printuid(", ", tcp->u_arg[3]);
-               tprints(", ");
-               printflags(at_flags, tcp->u_arg[4], "AT_???");
-       }
-       return 0;
-}
-
-int
-sys_fchown(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               printfd(tcp, tcp->u_arg[0]);
-               printuid(", ", tcp->u_arg[1]);
-               printuid(", ", tcp->u_arg[2]);
-       }
-       return 0;
-}