From: Michael Vrable Date: Fri, 10 Dec 2010 19:58:25 +0000 (-0800) Subject: Fixes and debugging assertions. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=bd90d0eef074977b2cd633d4fc9c482ccac2734d;p=bluesky.git Fixes and debugging assertions. --- diff --git a/bluesky/cleaner.c b/bluesky/cleaner.c index ec2b5dd..d7e29eb 100644 --- a/bluesky/cleaner.c +++ b/bluesky/cleaner.c @@ -142,8 +142,11 @@ static BlueSkyCleanerItem *bluesky_cleaner_find_checkpoint(BlueSkyFS *fs) length = item->length; } - if (length == 0) + if (length == 0) { + bluesky_cachefile_unref(cachefile); + g_mutex_unlock(cachefile->lock); return NULL; + } g_print("Found a cleaner checkpoint record.\n"); diff --git a/bluesky/cloudlog.c b/bluesky/cloudlog.c index 0570c5d..44799e3 100644 --- a/bluesky/cloudlog.c +++ b/bluesky/cloudlog.c @@ -389,6 +389,7 @@ BlueSkyCloudPointer bluesky_cloudlog_serialize(BlueSkyCloudLog *log, bluesky_cloudlog_serialize(ref, fs); } + /* FIXME: Ought lock to be taken earlier? */ g_mutex_lock(log->lock); bluesky_cloudlog_fetch(log); g_assert(log->data != NULL); diff --git a/bluesky/util.c b/bluesky/util.c index bf1d09e..3898c4a 100644 --- a/bluesky/util.c +++ b/bluesky/util.c @@ -83,6 +83,7 @@ BlueSkyRCStr *bluesky_string_new_from_mmap(BlueSkyCacheFile *mmap, int offset, gsize len) { g_assert(offset + len <= mmap->len); + g_assert(mmap->addr != NULL); BlueSkyRCStr *string = g_new(BlueSkyRCStr, 1); string->mmap = mmap;