From 6b6a55c2b4d2643ca0ee669a5bb3f42b6c98f107 Mon Sep 17 00:00:00 2001 From: Elvira Khabirova Date: Tue, 4 Aug 2015 02:16:20 +0300 Subject: [PATCH] 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. --- utime.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/utime.c b/utime.c index b21c799c..4f8f40a1 100644 --- a/utime.c +++ b/utime.c @@ -1,31 +1,23 @@ #include "defs.h" +#include DEF_MPERS_TYPE(utimbuf_t) + +#include + +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("[%s,", sprinttime(u.actime)); + tprintf(" %s]", sprinttime(u.modtime)); } - else - tprintf("", - wordsize); return RVAL_DECODED; } -- 2.40.0