mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Always log when getpriority fails - we will likely want to know
This commit is contained in:
@ -121,11 +121,13 @@ void game_mode_apply_renice(const GameModeContext *self, const pid_t client, int
|
|||||||
/* Clear errno as -1 is a regitimate return */
|
/* Clear errno as -1 is a regitimate return */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
int prio = getpriority(PRIO_PROCESS, (id_t)tid);
|
int prio = getpriority(PRIO_PROCESS, (id_t)tid);
|
||||||
|
|
||||||
if (prio == -1 && errno) {
|
if (prio == -1 && errno) {
|
||||||
/* process has likely ended, only log an error if we were actually trying to set a
|
/* Process may well have ended */
|
||||||
* non-zero value */
|
LOG_ERROR("getpriority failed for client [%d,%d] with error: %s\n",
|
||||||
if (errno == ESRCH && renice != 0)
|
client,
|
||||||
LOG_ERROR("getpriority returned ESRCH for process %d\n", tid);
|
tid,
|
||||||
|
strerror(errno));
|
||||||
} else if (prio != expected) {
|
} else if (prio != expected) {
|
||||||
/*
|
/*
|
||||||
* Don't adjust priority if it does not match the expected value
|
* Don't adjust priority if it does not match the expected value
|
||||||
|
Reference in New Issue
Block a user