2007-07-05 Roland McGrath <roland@redhat.com>
* file.c (sys_utime): Use personality_wordsize to handle biarch.
Fixes RH#247185.
diff --git a/file.c b/file.c
index 9262179..7c17063 100644
--- a/file.c
+++ b/file.c
@@ -2124,7 +2124,10 @@
sys_utime(tcp)
struct tcb *tcp;
{
- long ut[2];
+ union {
+ long utl[2];
+ int uti[2];
+ } u;
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
@@ -2133,13 +2136,22 @@
tprintf("NULL");
else if (!verbose(tcp))
tprintf("%#lx", tcp->u_arg[1]);
- else if (umoven(tcp, tcp->u_arg[1], sizeof ut,
- (char *) ut) < 0)
+ else if (umoven(tcp, tcp->u_arg[1],
+ 2 * personality_wordsize[current_personality],
+ (char *) &u) < 0)
tprintf("[?, ?]");
- else {
- tprintf("[%s,", sprinttime(ut[0]));
- tprintf(" %s]", sprinttime(ut[1]));
+ else if (personality_wordsize[current_personality]
+ == sizeof u.utl[0]) {
+ tprintf("[%s,", sprinttime(u.utl[0]));
+ tprintf(" %s]", sprinttime(u.utl[1]));
}
+ else if (personality_wordsize[current_personality]
+ == sizeof u.uti[0]) {
+ tprintf("[%s,", sprinttime(u.uti[0]));
+ tprintf(" %s]", sprinttime(u.uti[1]));
+ }
+ else
+ abort();
}
return 0;
}