]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
posix-cpu-timers: fix clock_gettime with CLOCK_PROCESS_CPUTIME_ID
authorPetr Tesarik <ptesarik@suse.cz>
Mon, 24 Nov 2008 14:46:31 +0000 (15:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 24 Nov 2008 15:41:40 +0000 (16:41 +0100)
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(-)

kernel/posix-cpu-timers.c

index 895337b16a24e7b9df95e8a9306b224bbe000971..4e5288a831de2e696260c12f97d60fdbcfc551a3 100644 (file)
@@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
        struct task_cputime cputime;
 
        thread_group_cputime(p, &cputime);
-       switch (which_clock) {
+       switch (CPUCLOCK_WHICH(which_clock)) {
        default:
                return -EINVAL;
        case CPUCLOCK_PROF: