summaryrefslogtreecommitdiff
path: root/src/journal/test-mmap-cache.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2014-09-06 10:36:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-09 23:16:36 -0400
commit06cc69d44c8ff2b652527357f28acd4cbe77c814 (patch)
treee660b1e180df8ac90be013a0fae8a5e148e8ad9e /src/journal/test-mmap-cache.c
parent853bd5cc72a0d4cbdd07cc3cabc65bef333a0c71 (diff)
sd-journal: fix sd_journal_enumerate_unique skipping values
sd_journal_enumerate_unique will lock its mmap window to prevent it from being released by calling mmap_cache_get with keep_always=true. This call may return windows that are wider, but compatible with the parameters provided to it. This can result in a mismatch where the window to be released cannot properly be selected, because we have more than one window matching the parameters of mmap_cache_release. Therefore, introduce a release_cookie to be used when releasing the window. https://bugs.freedesktop.org/show_bug.cgi?id=79380
Diffstat (limited to 'src/journal/test-mmap-cache.c')
-rw-r--r--src/journal/test-mmap-cache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index b7bb260fcf..778e884c3f 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -49,23 +49,23 @@ int main(int argc, char *argv[]) {
assert(z >= 0);
unlink(pz);
- r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p);
+ r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p, NULL);
assert(r >= 0);
- r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q);
+ r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q, NULL);
assert(r >= 0);
assert((uint8_t*) p + 1 == (uint8_t*) q);
- r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q);
+ r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q, NULL);
assert(r >= 0);
assert((uint8_t*) p + 2 == (uint8_t*) q);
- r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p);
+ r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p, NULL);
assert(r >= 0);
- r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q);
+ r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q, NULL);
assert(r >= 0);
assert((uint8_t*) p + 1 == (uint8_t*) q);