mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 07:37:21 +02:00
Make error messages for failure to change scheduling policies more descriptive
Out of the box on most distros, both of these steps will fail (renicing requires permission which may need adjustment to limits.conf, and the upstream kernel does not support SCHED_ISO). Explicitly state this in the error messages to hopefully reduce user confusion as to why these might be failing.
This commit is contained in:
parent
cdbe0db9a7
commit
442475a78b
@ -198,7 +198,7 @@ static void game_mode_apply_scheduler(GameModeContext *self, pid_t client)
|
||||
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, (int)renice)) {
|
||||
LOG_ERROR("Renicing client [%d] failed with error %d, ignoring.\n", client, errno);
|
||||
LOG_ERROR("Renicing client [%d] failed with error %d, ignoring (your user may not have permission to do this).\n", client, errno);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -221,7 +221,7 @@ static void game_mode_apply_scheduler(GameModeContext *self, pid_t client)
|
||||
if (!(strcmp(softrealtime, "off") == 0) && (enable_softrealtime)) {
|
||||
const struct sched_param p = { .sched_priority = 0 };
|
||||
if (sched_setscheduler(client, SCHED_ISO, &p)) {
|
||||
LOG_ERROR("Setting client [%d] to SCHED_ISO failed with error %d, ignoring.\n",
|
||||
LOG_ERROR("Setting client [%d] to SCHED_ISO failed with error %d, ignoring (your kernel may not support this).\n",
|
||||
client,
|
||||
errno);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user