From: Keir Fraser Date: Tue, 25 Aug 2009 13:55:22 +0000 (+0100) Subject: xen/x86: make do_settimeofday() return -EPERM when clock can't be changed X-Git-Tag: xen-3.4.2~11 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=118e1ea4985c4077443bd760af1342c795348202;p=legacy%2Flinux-2.6.18-xen.git xen/x86: make do_settimeofday() return -EPERM when clock can't be changed 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 --- diff --git a/arch/i386/kernel/time-xen.c b/arch/i386/kernel/time-xen.c index 0ada016f..9d7e342e 100644 --- a/arch/i386/kernel/time-xen.c +++ b/arch/i386/kernel/time-xen.c @@ -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);