Explorar o código

posix-cpu-timers: fix clock_gettime with CLOCK_PROCESS_CPUTIME_ID

Since CLOCK_PROCESS_CPUTIME_ID is in fact translated to -6, the switch
statement in cpu_clock_sample_group() must first mask off the irrelevant
bits, similar to cpu_clock_sample().

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

--
 posix-cpu-timers.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Petr Tesarik %!s(int64=16) %!d(string=hai) anos
pai
achega
eccdaeafae
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      kernel/posix-cpu-timers.c

+ 1 - 1
kernel/posix-cpu-timers.c

@@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
 	struct task_cputime cputime;
 	struct task_cputime cputime;
 
 
 	thread_group_cputime(p, &cputime);
 	thread_group_cputime(p, &cputime);
-	switch (which_clock) {
+	switch (CPUCLOCK_WHICH(which_clock)) {
 	default:
 	default:
 		return -EINVAL;
 		return -EINVAL;
 	case CPUCLOCK_PROF:
 	case CPUCLOCK_PROF: