]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix typo in timing changes + support for x86-64
authorAndi Kleen <ak@suse.de>
Sun, 15 Jun 2003 20:17:24 +0000 (13:17 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 15 Jun 2003 20:17:24 +0000 (13:17 -0700)
The us->ns conversion must be in the "tv" if branch of settimeofday,
not in the "tz" if.

Also make it compile for x86-64 again. The 32bit emulation was forgotten
in the conversion.

arch/x86_64/ia32/sys_ia32.c
kernel/time.c

index d7446a1834da85498e72cd0baccd3c67f6342f65..90358543ed5ef5a30671a0b1131511b17cf4403f 100644 (file)
@@ -452,7 +452,6 @@ sys32_alarm(unsigned int seconds)
    sorts of things, like timeval and itimerval.  */
 
 extern struct timezone sys_tz;
-extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
 
 asmlinkage long
 sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
@@ -474,18 +473,21 @@ asmlinkage long
 sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
 {
        struct timeval ktv;
+       struct timespec kts;
        struct timezone ktz;
 
        if (tv) {
                if (get_tv32(&ktv, tv))
                        return -EFAULT;
+               kts.tv_sec = ktv.tv_sec;
+               kts.tv_nsec = ktv.tv_usec * NSEC_PER_USEC;
        }
        if (tz) {
                if (copy_from_user(&ktz, tz, sizeof(ktz)))
                        return -EFAULT;
        }
 
-       return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL);
+       return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
 struct linux32_dirent {
index 6f6e173d9eebc530d2c9596e42edd7dadb2b7985..beb7b007b443d0fb1ad3b21eafe0c6f55d6733da 100644 (file)
@@ -168,11 +168,11 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv, struct timezone __us
        if (tv) {
                if (copy_from_user(&new_tv, tv, sizeof(*tv)))
                        return -EFAULT;
+               new_tv.tv_nsec *= NSEC_PER_USEC;
        }
        if (tz) {
                if (copy_from_user(&new_tz, tz, sizeof(*tz)))
                        return -EFAULT;
-               new_tv.tv_nsec *= NSEC_PER_USEC;
        }
 
        return do_sys_settimeofday(tv ? &new_tv : NULL, tz ? &new_tz : NULL);