]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/fileio.h
Advertise hibernation only if there's enough free swap
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 13 Sep 2013 23:41:52 +0000 (19:41 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 13 Sep 2013 23:41:52 +0000 (19:41 -0400)
commit69ab80881552d5f79ca95f6b3be48ad122ab1ec2
tree6b099f9f4f5693bb819ca4ac7dda4ad2798177b3
parente39ff1f48d7ffcf7c20f9178ec64efbd7e244cab
Advertise hibernation only if there's enough free swap

Condition that is checked is taken from upower:
  active(anon) < free swap * 0.98

This is really stupid, because the kernel knows the situation better,
e.g. there could be two swap files, and then hibernation would be
impossible despite passing this check, or the kernel could start
supporting compressed swap and/or compressed hibernation images, and
then this this check would be too stringent. Nevertheless, until
we have something better, this should at least return a true negative
if there's no swap.

Logging of capabilities in the journal is changed to not strip leading
zeros. I consider this more readable anyway.

http://cgit.freedesktop.org/upower/tree/src/up-daemon.c#n613
https://bugzilla.redhat.com/show_bug.cgi?id=1007059
src/shared/fileio.c
src/shared/fileio.h
src/shared/logs-show.c
src/shared/sleep-config.c
src/shared/util.c
src/test/test-fileio.c
src/test/test-sleep.c