Re: [PATCH] sched: fix sched_setparam() policy=-1 logic

2014-07-23 Thread Peter Zijlstra
On Tue, Jul 22, 2014 at 11:27:41PM -0300, Daniel Bristot de Oliveira wrote: > The scheduler uses policy=-1 to preserve the current policy state to > implement sched_setparam(). But, as (int) -1 is equals to 0x, > it's matching the if (policy & SCHED_RESET_ON_FORK) on > _sched_setscheduler()

[PATCH] sched: fix sched_setparam() policy=-1 logic

2014-07-22 Thread Daniel Bristot de Oliveira
The scheduler uses policy=-1 to preserve the current policy state to implement sched_setparam(). But, as (int) -1 is equals to 0x, it's matching the if (policy & SCHED_RESET_ON_FORK) on _sched_setscheduler(). This match changes the policy value to an invalid value, breaking the sched_setpar