mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 15:47:20 +02:00
scheduler: Don't renice if already reniced
This is a heuristic to not apply a nice level if the user already did that (or the process itself). Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
parent
76ece2fc26
commit
d8231a2972
@ -179,7 +179,12 @@ static void game_mode_apply_scheduler(pid_t client)
|
||||
{
|
||||
LOG_MSG("Setting scheduling policies...\n");
|
||||
|
||||
if (setpriority(PRIO_PROCESS, (id_t)client, NICE_PRIORITY)) {
|
||||
/*
|
||||
* don't adjust priority if it was already adjusted
|
||||
*/
|
||||
if (getpriority(PRIO_PROCESS, (id_t)client) != 0) {
|
||||
LOG_ERROR("Client [%d] already reniced, ignoring.\n", client);
|
||||
} else if (setpriority(PRIO_PROCESS, (id_t)client, NICE_PRIORITY)) {
|
||||
LOG_ERROR("Renicing client [%d] failed with error %d, ignoring.\n", client, errno);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user