chiark / gitweb /
core: move config_parse_set_status() into load-fragment.c
[elogind.git] / src / shared / sleep-config.c
index 70a08960690060abd583c20f5650733e4b3935e4..cf1cd400e8fb281d0cb3149f8dc17f3154649333 100644 (file)
@@ -174,7 +174,7 @@ static int hibernation_partition_size(size_t *size, size_t *used) {
         assert(size);
         assert(used);
 
-        f = fopen("/proc/swaps", "r");
+        f = fopen("/proc/swaps", "re");
         if (!f) {
                 log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
                          "Failed to retrieve open /proc/swaps: %m");
@@ -220,8 +220,8 @@ static int hibernation_partition_size(size_t *size, size_t *used) {
 
 static bool enough_memory_for_hibernation(void) {
         _cleanup_free_ char *active = NULL;
-        unsigned long long act;
-        size_t size, used;
+        unsigned long long act = 0;
+        size_t size = 0, used = 0;
         int r;
 
         r = hibernation_partition_size(&size, &used);