]> granicus.if.org Git - strace/blobdiff - utime.c
print_array: enhance printing of unfetchable object addresses
[strace] / utime.c
diff --git a/utime.c b/utime.c
index 4626c9197719dda50b32e9d012dfee2c2894d806..6ab6d8923b3690812c1f255c48ef94e6dcfe50b0 100644 (file)
--- a/utime.c
+++ b/utime.c
@@ -1,32 +1,26 @@
 #include "defs.h"
 
+#include DEF_MPERS_TYPE(utimbuf_t)
+
+#include <utime.h>
+
+typedef struct utimbuf utimbuf_t;
+
+#include MPERS_DEFS
+
 SYS_FUNC(utime)
 {
-       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(", ");
+       utimbuf_t u;
 
-               wordsize = current_wordsize;
-               if (umoven_or_printaddr(tcp, tcp->u_arg[1], 2 * wordsize, &u))
-                       ;
-               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);
+       printpath(tcp, tcp->u_arg[0]);
+       tprints(", ");
+       if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) {
+               tprintf("{actime=%lld", (long long) u.actime);
+               tprints_comment(sprinttime(u.actime));
+               tprintf(", modtime=%lld", (long long) u.modtime);
+               tprints_comment(sprinttime(u.modtime));
+               tprints("}");
        }
-       return 0;
+
+       return RVAL_DECODED;
 }