Fix UP_DAEMON_WATERLINE harder

Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active
memory)/(available swap), not the other way around. So replace it with 99%
instead.

Also update the documentation of up_backend_get_used_swap() to explain what the
returned percentage actually means.
This commit is contained in:
Martin Pitt 2010-07-07 15:01:27 +02:00
parent 04eefe984c
commit c4a1c15d0c
2 changed files with 5 additions and 4 deletions

View file

@ -480,7 +480,8 @@ out:
/**
* up_backend_get_used_swap:
*
* Return value: a percentage value
* Return value: a percentage value how much of the available swap memory would
* be taken by currently active memory
**/
gfloat
up_backend_get_used_swap (UpBackend *backend)

View file

@ -105,9 +105,9 @@ G_DEFINE_TYPE (UpDaemon, up_daemon, G_TYPE_OBJECT)
/* if using more memory compared to usable swap, disable hibernate */
/* Native Linux suspend-to-disk does not use compression, and needs 2 KB of
* page meta information for each MB of active memory. Add an extra .05% to
* prevent rounding errors. */
#define UP_DAEMON_SWAP_WATERLINE 100.25f /* % */
* page meta information for each MB of active memory. Add some error margin
* here, though. */
#define UP_DAEMON_SWAP_WATERLINE 98f /* % */
/* refresh all the devices after this much time when on-battery has changed */
#define UP_DAEMON_ON_BATTERY_REFRESH_DEVICES_DELAY 1 /* seconds */