chiark / gitweb /
hostnamed: introduce systemd-hostnamed
[elogind.git] / src / readahead-collect.c
index ca8227135e06336e8be082a2c197c6afa8b67702..3c48a02fc9e49dc9a92c3e43d4715a0dbcbfbbe9 100644 (file)
@@ -119,9 +119,10 @@ static int pack_file(FILE *pack, const char *fn, bool on_btrfs) {
                 goto finish;
         }
 
-        pages = l / PAGE_SIZE;
+        pages = l / page_size();
 
         vec = alloca(pages);
+        memset(vec, 0, pages);
         if (mincore(start, l, vec) < 0) {
                 log_warning("mincore(%s) failed: %m", fn);
                 r = -errno;
@@ -289,13 +290,13 @@ static int collect(const char *root) {
 
         log_debug("Collecting...");
 
-        if (access("/dev/.run/systemd/readahead/cancel", F_OK) >= 0) {
+        if (access("/run/systemd/readahead/cancel", F_OK) >= 0) {
                 log_debug("Collection canceled");
                 r = -ECANCELED;
                 goto finish;
         }
 
-        if (access("/dev/.run/systemd/readahead/done", F_OK) >= 0) {
+        if (access("/run/systemd/readahead/done", F_OK) >= 0) {
                 log_debug("Got termination request");
                 goto done;
         }