X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Freadahead-replay.c;h=e22fc04392a8ad7d3d9e8d057b04d3d415bcc050;hb=c7b508592b28ee1e62350f0d249856811371f631;hp=32941c144d5553dddcda4ca6dc7e88f04caf50b0;hpb=6e66797af44164c002127c4664064bf60a2fc13b;p=elogind.git diff --git a/src/readahead-replay.c b/src/readahead-replay.c index 32941c144..e22fc0439 100644 --- a/src/readahead-replay.c +++ b/src/readahead-replay.c @@ -44,6 +44,8 @@ static off_t arg_file_size_max = READAHEAD_FILE_SIZE_MAX; +static ReadaheadShared *shared = NULL; + static int unpack_file(FILE *pack) { char fn[PATH_MAX]; int r = 0, fd = -1; @@ -114,7 +116,7 @@ finish: } static int replay(const char *root) { - FILE *pack; + FILE *pack = NULL; char line[LINE_MAX]; int r = 0; char *pack_fn = NULL, c; @@ -338,6 +340,12 @@ int main(int argc, char*argv[]) { return 0; } + if (!(shared = shared_get())) + return 1; + + shared->replay = getpid(); + __sync_synchronize(); + if (replay(optind < argc ? argv[optind] : "/") < 0) return 1;