GNOME Bugzilla – Bug 771543
power: Clamp the battery/mains timeouts
Last modified: 2016-10-14 17:11:07 UTC
.
Created attachment 335720 [details] [review] power: Clamp the battery/mains timeouts As the value can be < 0, make sure that we don't set up timeouts for negative amounts of time.
Review of attachment 335720 [details] [review]: ::: plugins/power/gsd-power-manager.c @@ +1717,3 @@ timeout_sleep = g_settings_get_int (manager->priv->settings, on_battery ? "sleep-inactive-battery-timeout" : "sleep-inactive-ac-timeout"); + timeout_sleep = CLAMP(timeout_sleep, 0, G_MAXINT); Missing space? CLAMP (timeout_sleep, 0, G_MAXINT)?
(In reply to Michael Catanzaro from comment #2) > Review of attachment 335720 [details] [review] [review]: > > ::: plugins/power/gsd-power-manager.c > @@ +1717,3 @@ > timeout_sleep = g_settings_get_int > (manager->priv->settings, on_battery ? > > "sleep-inactive-battery-timeout" : "sleep-inactive-ac-timeout"); > + timeout_sleep = CLAMP(timeout_sleep, 0, G_MAXINT); > > Missing space? CLAMP (timeout_sleep, 0, G_MAXINT)? I don't usually have spaces before the parens for macros.
Was committed in: commit a228fd4dc298c02f7c8b359c36f71ba8243f51f5 Author: Bastien Nocera <hadess@hadess.net> Date: Fri Sep 16 17:45:38 2016 +0200 power: Clamp the battery/mains timeouts As the value can be < 0, make sure that we don't set up timeouts for negative amounts of time. https://bugzilla.gnome.org/show_bug.cgi?id=771543