Assume that /proc/meminfo can be missing

Travis tests are failing, probably because /proc/meminfo is not available
in the test environment. The same might be true in some virtualized systems,
so just treat missing /proc/meminfo as a sign that hibernation is not
possible.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2013-09-16 09:47:28 -05:00
parent 112a7f4696
commit 442e00839e
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -172,7 +172,8 @@ static bool enough_memory_for_hibernation(void) {
r = get_status_field("/proc/meminfo", "\nSwapFree:", &swapfree);
if (r < 0) {
log_error("Failed to retrieve SwapFree from /proc/meminfo: %s", strerror(-r));
log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
"Failed to retrieve SwapFree from /proc/meminfo: %s", strerror(-r));
return false;
}