Skip to content

Commit

Permalink
posix-cpu-timers: fix clock_gettime with CLOCK_PROCESS_CPUTIME_ID
Browse files Browse the repository at this point in the history
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(-)
  • Loading branch information
Petr Tesarik authored and Thomas Gleixner committed Nov 24, 2008
1 parent 13d428a commit eccdaea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eccdaea

Please sign in to comment.