file.c: move utime parser 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:16 +0000 (21:39 +0000)
* utime.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c (sys_utime): Move to utime.c.

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

index 0516344ff0c75b3fe5780b9f30d03f1b7b1e10fc..ae535d4205565bb13a23889ed00b019bfa1a5d16 100644 (file)
@@ -72,6 +72,7 @@ strace_SOURCES =      \
        time.c          \
        umount.c        \
        util.c          \
+       utime.c         \
        v4l2.c          \
        vsprintf.c      \
        xattr.c
diff --git a/file.c b/file.c
index af09189001e6b4acf68dcffe3fb99a33368446ba..502eb5249da67b0e209c77d540d091869aa7cf9e 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1519,39 +1519,3 @@ sys_utimensat(struct tcb *tcp)
        }
        return 0;
 }
-
-int
-sys_utime(struct tcb *tcp)
-{
-       union {
-               long utl[2];
-               int uti[2];
-               long paranoia_for_huge_wordsize[4];
-       } u;
-       unsigned wordsize;
-
-       if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[0]);
-               tprints(", ");
-
-               wordsize = current_wordsize;
-               if (!tcp->u_arg[1])
-                       tprints("NULL");
-               else if (!verbose(tcp))
-                       tprintf("%#lx", tcp->u_arg[1]);
-               else if (umoven(tcp, tcp->u_arg[1], 2 * wordsize, (char *) &u) < 0)
-                       tprints("[?, ?]");
-               else if (wordsize == sizeof u.utl[0]) {
-                       tprintf("[%s,", sprinttime(u.utl[0]));
-                       tprintf(" %s]", sprinttime(u.utl[1]));
-               }
-               else if (wordsize == sizeof u.uti[0]) {
-                       tprintf("[%s,", sprinttime(u.uti[0]));
-                       tprintf(" %s]", sprinttime(u.uti[1]));
-               }
-               else
-                       tprintf("<decode error: unsupported wordsize %d>",
-                               wordsize);
-       }
-       return 0;
-}
diff --git a/utime.c b/utime.c
new file mode 100644 (file)
index 0000000..6e396b0
--- /dev/null
+++ b/utime.c
@@ -0,0 +1,37 @@
+#include "defs.h"
+
+int
+sys_utime(struct tcb *tcp)
+{
+       union {
+               long utl[2];
+               int uti[2];
+               long paranoia_for_huge_wordsize[4];
+       } u;
+       unsigned wordsize;
+
+       if (entering(tcp)) {
+               printpath(tcp, tcp->u_arg[0]);
+               tprints(", ");
+
+               wordsize = current_wordsize;
+               if (!tcp->u_arg[1])
+                       tprints("NULL");
+               else if (!verbose(tcp))
+                       tprintf("%#lx", tcp->u_arg[1]);
+               else if (umoven(tcp, tcp->u_arg[1], 2 * wordsize, (char *) &u) < 0)
+                       tprints("[?, ?]");
+               else if (wordsize == sizeof u.utl[0]) {
+                       tprintf("[%s,", sprinttime(u.utl[0]));
+                       tprintf(" %s]", sprinttime(u.utl[1]));
+               }
+               else if (wordsize == sizeof u.uti[0]) {
+                       tprintf("[%s,", sprinttime(u.uti[0]));
+                       tprintf(" %s]", sprinttime(u.uti[1]));
+               }
+               else
+                       tprintf("<decode error: unsupported wordsize %d>",
+                               wordsize);
+       }
+       return 0;
+}