X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Flog.c;h=984cf163dee8c8ea8cf0dc8cae02a4543858b947;hb=f6edd13c644ec73c0f57aa580514413372ce3f0e;hp=03f4fb3ba5a74df649313c147af8dfc43f8e798e;hpb=0e94ccdf181e154c366dc5169c970b149af000e5;p=bluesky.git diff --git a/bluesky/log.c b/bluesky/log.c index 03f4fb3..984cf16 100644 --- a/bluesky/log.c +++ b/bluesky/log.c @@ -550,6 +550,8 @@ static void cloudlog_partial_fetch_complete(BlueSkyStoreAsync *async, g_warning("Unable to open and write to cache file %s: %m", cachefile->filename); } + + bluesky_rangeset_free(items); } else { g_print("Error fetching from cloud, retrying...\n"); cloudlog_partial_fetch_start(cachefile, async->start, async->len); @@ -749,7 +751,7 @@ void bluesky_mmap_unref(BlueSkyCacheFile *mmap) if (g_atomic_int_dec_and_test(&mmap->mapcount)) { g_mutex_lock(mmap->lock); - if (mmap->addr != NULL) { + if (mmap->addr != NULL && g_atomic_int_get(&mmap->mapcount) == 0) { if (bluesky_verbose) g_print("Unmapped log segment %d...\n", mmap->log_seq); munmap((void *)mmap->addr, mmap->len);