X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Freadahead%2Freadahead-replay.c;h=a6529f8bace696c8a01393dcfafe7e62a9b71ebf;hb=4019a16d5b65633e5f6d671c16d3215d7f7f29fc;hp=0c739c82be86d36a86b42bf0ae8a64b5c4e6ba3e;hpb=19c5f19d69bb5f520fa7213239490c55de06d99d;p=elogind.git diff --git a/src/readahead/readahead-replay.c b/src/readahead/readahead-replay.c index 0c739c82b..a6529f8ba 100644 --- a/src/readahead/readahead-replay.c +++ b/src/readahead/readahead-replay.c @@ -6,16 +6,16 @@ Copyright 2010 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -132,8 +132,7 @@ static int replay(const char *root) { assert(root); - write_one_line_file("/proc/self/oom_score_adj", "1000"); - bump_request_nr(root); + block_bump_request_nr(root); if (asprintf(&pack_fn, "%s/.readahead", root) < 0) { log_error("Out of memory"); @@ -350,7 +349,8 @@ int main(int argc, char*argv[]) { umask(0022); - if ((r = parse_argv(argc, argv)) <= 0) + r = parse_argv(argc, argv); + if (r <= 0) return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; root = optind < argc ? argv[optind] : "/"; @@ -360,12 +360,8 @@ 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())) + shared = shared_get(); + if (!shared) return 1; shared->replay = getpid();