chiark / gitweb /
condition: drop pointless double negation
[elogind.git] / src / readahead-replay.c
index 87f2e598b41fbee218a3ad33b577c5b4f855b5ec..cd89654f983d105e7731b9d2dd7ae4ec7a9ad7ba 100644 (file)
@@ -62,7 +62,7 @@ static int unpack_file(FILE *pack) {
 
         if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0) {
 
-                if (errno != ENOENT)
+                if (errno != ENOENT && errno != EPERM && errno != EACCES)
                         log_warning("open(%s) failed: %m", fn);
 
         } else if (file_verify(fd, fn, arg_file_size_max, &st) <= 0) {
@@ -346,6 +346,11 @@ int main(int argc, char*argv[]) {
                 return 0;
         }
 
+        if (detect_virtualization(NULL) > 0) {
+                log_info("Disabling readahead replay due to execution in virtualized environment.");
+                return 0;
+        }
+
         if (!(shared = shared_get()))
                 return 1;