mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-06 13:18:31 +02:00
Set up for resetting niceness value
Add tests to check this feature Apply config validation in config for simplicity Note: if anything messes with the niceness (ie. it starts non-zero, or it's not the expected value during setup, we'll bail out)
This commit is contained in:
@@ -548,6 +548,11 @@ long config_get_renice_value(GameModeConfig *self)
|
||||
{
|
||||
long value = 0;
|
||||
memcpy_locked_config(self, &value, &self->values.renice, sizeof(long));
|
||||
/* Validate the renice value */
|
||||
if ((value < 1 || value > 20) && value != 0) {
|
||||
LOG_ONCE(ERROR, "Configured renice value '%ld' is invalid, will not renice.\n", value);
|
||||
value = 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user