chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udev: mark hvc devices for exposure in systemd
[elogind.git]
/
src
/
readahead-collect.c
diff --git
a/src/readahead-collect.c
b/src/readahead-collect.c
index 75e7a2870bad679b937dadfc38757dbd6252ccf8..330d10776fc209609896aceac67a58b3ef41e8ac 100644
(file)
--- a/
src/readahead-collect.c
+++ b/
src/readahead-collect.c
@@
-92,6
+92,13
@@
static int pack_file(FILE *pack, const char *fn, bool on_btrfs) {
assert(fn);
if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0) {
assert(fn);
if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0) {
+
+ if (errno == ENOENT)
+ return 0;
+
+ if (errno == EPERM || errno == EACCES)
+ return 0;
+
log_warning("open(%s) failed: %m", fn);
r = -errno;
goto finish;
log_warning("open(%s) failed: %m", fn);
r = -errno;
goto finish;
@@
-398,8
+405,8
@@
static int collect(const char *root) {
char_array_0(fn);
if ((k = readlink_malloc(fn, &p)) >= 0) {
char_array_0(fn);
if ((k = readlink_malloc(fn, &p)) >= 0) {
-
if (startswith(p, "/tmp") ||
if (startswith(p, "/tmp") ||
+ endswith(p, " (deleted)") ||
hashmap_get(files, p))
/* Not interesting, or
* already read */
hashmap_get(files, p))
/* Not interesting, or
* already read */
@@
-645,6
+652,11
@@
int main(int argc, char *argv[]) {
return 0;
}
return 0;
}
+ if (detect_virtualization(NULL) > 0) {
+ log_info("Disabling readahead collector due to execution in virtualized environment.");
+ return 0;
+ }
+
if (!(shared = shared_get()))
return 1;
if (!(shared = shared_get()))
return 1;