]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen/x86: make do_settimeofday() return -EPERM when clock can't be changed
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Aug 2009 13:55:22 +0000 (14:55 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Aug 2009 13:55:22 +0000 (14:55 +0100)
Rather than returning success here (without actually having done
anything), it seems more appropriate/conforming to let the caller know
that what he intended to do didn't succeed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/kernel/time-xen.c

index 0ada016f4d11dd1dad9ebe5f4300c53cf6b1ac5a..9d7e342e254e09a9add402d6638f9ba21d147fec 100644 (file)
@@ -463,6 +463,9 @@ int do_settimeofday(struct timespec *tv)
        if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
                return -EINVAL;
 
+       if (!is_initial_xendomain() && !independent_wallclock)
+               return -EPERM;
+
        cpu = get_cpu();
        shadow = &per_cpu(shadow_time, cpu);