]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/alpha/kernel/osf_sys.c
alpha: build fixes
[linux-2.6-omap-h63xx.git] / arch / alpha / kernel / osf_sys.c
index ea405f5713ce0e75e72a18fb960955f02153c28b..6413c5f232264dbc9b165489396dbb6987d42351 100644 (file)
@@ -715,7 +715,7 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
                /* 
                 * Alpha Architecture Handbook 4.7.7.3:
                 * To be fully IEEE compiant, we must track the current IEEE
-                * exception state in software, because spurrious bits can be
+                * exception state in software, because spurious bits can be
                 * set in the trap shadow of a software-complete insn.
                 */
 
@@ -953,15 +953,25 @@ osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __use
 asmlinkage int
 osf_utimes(char __user *filename, struct timeval32 __user *tvs)
 {
-       struct timeval ktvs[2];
+       struct timespec tv[2];
 
        if (tvs) {
+               struct timeval ktvs[2];
                if (get_tv32(&ktvs[0], &tvs[0]) ||
                    get_tv32(&ktvs[1], &tvs[1]))
                        return -EFAULT;
+
+               if (ktvs[0].tv_usec < 0 || ktvs[0].tv_usec >= 1000000 ||
+                   ktvs[1].tv_usec < 0 || ktvs[1].tv_usec >= 1000000)
+                       return -EINVAL;
+
+               tv[0].tv_sec = ktvs[0].tv_sec;
+               tv[0].tv_nsec = 1000 * ktvs[0].tv_usec;
+               tv[1].tv_sec = ktvs[1].tv_sec;
+               tv[1].tv_nsec = 1000 * ktvs[1].tv_usec;
        }
 
-       return do_utimes(AT_FDCWD, filename, tvs ? ktvs : NULL);
+       return do_utimes(AT_FDCWD, filename, tvs ? tv : NULL, 0);
 }
 
 #define MAX_SELECT_SECONDS \