Mpersify parser of utime syscall
Fix multiple personalities support in parser of utime syscall by using
mpersified utimbuf_t typedef.
* utime.c (utimbuf_t): New typedef. Mpersify it.
(sys_utime): Use it instead of a locally defined union.
diff --git a/utime.c b/utime.c
index b21c799..4f8f40a 100644
--- 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]));
+ if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) {
+ tprintf("[%s,", sprinttime(u.actime));
+ tprintf(" %s]", sprinttime(u.modtime));
}
- 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 RVAL_DECODED;
}