X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Freadahead-collect.c;h=df467f1a42d71182df432b09ae4d986bcdc52f28;hb=a5afffa151b9969bfb138c409c6092ce12fba340;hp=913a34005e3c69f8a8c31dfa5510997e68bb9a17;hpb=3afe3725fcf21fab7204243b9485a118e499b4a3;p=elogind.git diff --git a/src/readahead-collect.c b/src/readahead-collect.c index 913a34005..df467f1a4 100644 --- a/src/readahead-collect.c +++ b/src/readahead-collect.c @@ -380,7 +380,17 @@ static int collect(const char *root) { if ((n = read(fanotify_fd, &data, sizeof(data))) < 0) { - if (errno == EINTR || errno == EAGAIN || errno == EACCES) + if (errno == EINTR || errno == EAGAIN) + continue; + + /* fanotify sometimes returns EACCES on read() + * where it shouldn't. For now let's just + * ignore it here (which is safe), but + * eventually this should be + * dropped when the kernel is fixed. + * + * https://bugzilla.redhat.com/show_bug.cgi?id=707577 */ + if (errno == EACCES) continue; log_error("Failed to read event: %m"); @@ -646,6 +656,8 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); + umask(0022); + if ((r = parse_argv(argc, argv)) <= 0) return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;