]> granicus.if.org Git - strace/commitdiff
file.c: move utimes, futimesat, utimensat, and osf_utimes 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:21 +0000 (21:39 +0000)
* utimes.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat,
sys_osf_utimes): Move to utimes.c.

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

index ae535d4205565bb13a23889ed00b019bfa1a5d16..5452d00ba88d3cd9a1fb89f60c536122ff10349f 100644 (file)
@@ -73,6 +73,7 @@ strace_SOURCES =      \
        umount.c        \
        util.c          \
        utime.c         \
+       utimes.c        \
        v4l2.c          \
        vsprintf.c      \
        xattr.c
diff --git a/file.c b/file.c
index 502eb5249da67b0e209c77d540d091869aa7cf9e..95b2c32a96fb4385ec1931ba842abcb0c79c0214 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1458,64 +1458,3 @@ sys_fchmod(struct tcb *tcp)
        }
        return 0;
 }
-
-#ifdef ALPHA
-int
-sys_osf_utimes(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[0]);
-               tprints(", ");
-               printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32,  0);
-       }
-       return 0;
-}
-#endif
-
-static int
-decode_utimes(struct tcb *tcp, int offset, int special)
-{
-       if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[offset]);
-               tprints(", ");
-               if (tcp->u_arg[offset + 1] == 0)
-                       tprints("NULL");
-               else {
-                       tprints("{");
-                       printtv_bitness(tcp, tcp->u_arg[offset + 1],
-                                       BITNESS_CURRENT, special);
-                       tprints(", ");
-                       printtv_bitness(tcp, tcp->u_arg[offset + 1]
-                                       + sizeof(struct timeval),
-                                       BITNESS_CURRENT, special);
-                       tprints("}");
-               }
-       }
-       return 0;
-}
-
-int
-sys_utimes(struct tcb *tcp)
-{
-       return decode_utimes(tcp, 0, 0);
-}
-
-int
-sys_futimesat(struct tcb *tcp)
-{
-       if (entering(tcp))
-               print_dirfd(tcp, tcp->u_arg[0]);
-       return decode_utimes(tcp, 1, 0);
-}
-
-int
-sys_utimensat(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               print_dirfd(tcp, tcp->u_arg[0]);
-               decode_utimes(tcp, 1, 1);
-               tprints(", ");
-               printflags(at_flags, tcp->u_arg[3], "AT_???");
-       }
-       return 0;
-}
diff --git a/utimes.c b/utimes.c
new file mode 100644 (file)
index 0000000..40f9566
--- /dev/null
+++ b/utimes.c
@@ -0,0 +1,62 @@
+#include "defs.h"
+
+static int
+decode_utimes(struct tcb *tcp, int offset, int special)
+{
+       if (entering(tcp)) {
+               printpath(tcp, tcp->u_arg[offset]);
+               tprints(", ");
+               if (tcp->u_arg[offset + 1] == 0)
+                       tprints("NULL");
+               else {
+                       tprints("{");
+                       printtv_bitness(tcp, tcp->u_arg[offset + 1],
+                                       BITNESS_CURRENT, special);
+                       tprints(", ");
+                       printtv_bitness(tcp, tcp->u_arg[offset + 1]
+                                       + sizeof(struct timeval),
+                                       BITNESS_CURRENT, special);
+                       tprints("}");
+               }
+       }
+       return 0;
+}
+
+int
+sys_utimes(struct tcb *tcp)
+{
+       return decode_utimes(tcp, 0, 0);
+}
+
+int
+sys_futimesat(struct tcb *tcp)
+{
+       if (entering(tcp))
+               print_dirfd(tcp, tcp->u_arg[0]);
+       return decode_utimes(tcp, 1, 0);
+}
+
+int
+sys_utimensat(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               print_dirfd(tcp, tcp->u_arg[0]);
+               decode_utimes(tcp, 1, 1);
+               tprints(", ");
+               printflags(at_flags, tcp->u_arg[3], "AT_???");
+       }
+       return 0;
+}
+
+#ifdef ALPHA
+int
+sys_osf_utimes(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               printpath(tcp, tcp->u_arg[0]);
+               tprints(", ");
+               printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32,  0);
+       }
+       return 0;
+}
+#endif /* ALPHA */