]> granicus.if.org Git - strace/blobdiff - utime.c
Update NEWS
[strace] / utime.c
diff --git a/utime.c b/utime.c
index b21c799c78bbe639b3de958ef76849f0a3690944..8126b350f25abcfb6a0d93b012c40a2e2dbe4626 100644 (file)
--- a/utime.c
+++ b/utime.c
@@ -1,31 +1,23 @@
 #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;
+       utimbuf_t u;
 
        printpath(tcp, tcp->u_arg[0]);
        tprints(", ");
-
-       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]));
+       if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) {
+               tprintf("{actime=%s,", sprinttime(u.actime));
+               tprintf(" modtime=%s}", sprinttime(u.modtime));
        }
-       else
-               tprintf("<decode error: unsupported wordsize %d>",
-                       wordsize);
 
        return RVAL_DECODED;
 }