aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-03 19:23:07 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-03 19:23:07 +0000
commitf72e8ff4a698c13c69b9f3f06a56b60ca5af3a78 (patch)
tree8c6d0459b80e7b64febb1590a06bd5385e3f79a5 /linux-user
parentb06eddd39de08025a17cee1fd43c31458dfeb69f (diff)
utime fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@780 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 79d239ffa2..37d644dd95 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1729,11 +1729,16 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
break;
case TARGET_NR_utime:
{
- struct utimbuf tbuf;
+ struct utimbuf tbuf, *tbuf1;
struct target_utimbuf *target_tbuf = (void *)arg2;
- tbuf.actime = tswapl(target_tbuf->actime);
- tbuf.modtime = tswapl(target_tbuf->modtime);
- ret = get_errno(utime((const char *)arg1, &tbuf));
+ if (target_tbuf) {
+ get_user(tbuf.actime, &target_tbuf->actime);
+ get_user(tbuf.modtime, &target_tbuf->modtime);
+ tbuf1 = &tbuf;
+ } else {
+ tbuf1 = NULL;
+ }
+ ret = get_errno(utime((const char *)arg1, tbuf1));
}
break;
#ifdef TARGET_NR_stty