Skip to contentSkip to conversation

linux/x86: make do_settimeofday() return -EPERM when clock can't be changed

PATCH New Jan Beulich 1 participant 1 message Aug 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/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.

arch/i386/kernel/time-xen.c +3 -0
@@ -470,6 +470,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);