From: short <> Date: Sat, 13 Sep 2003 06:59:46 +0000 (+0000) Subject: Report user-readable error for not yet supported large non-mappable areas. X-Git-Tag: captive-0_9~71 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=338e03d575467dd519013c7fdbecdfbdf7cdb800;p=captive.git Report user-readable error for not yet supported large non-mappable areas. --- diff --git a/src/libcaptive/cc/sharedcachemap.c b/src/libcaptive/cc/sharedcachemap.c index f1b925e..298d47d 100644 --- a/src/libcaptive/cc/sharedcachemap.c +++ b/src/libcaptive/cc/sharedcachemap.c @@ -175,7 +175,11 @@ guint64 size64_old,size64_new; g_assert(size_old==size64_old); size64_new=CAPTIVE_ROUND_UP64(AllocationSize,PAGE_SIZE); size_new=size64_new; - g_assert(size_new==size64_new); + if (size_new!=size64_new) { +size_new_big: + g_error("Mapped size %" G_GUINT64_FORMAT " is too big; FIXME: non-mmap(2)-able areas not yet supported",size64_new); + g_assert_not_reached(); + } if (size_old!=size_new) { gpointer buffer_new; @@ -195,6 +199,8 @@ int errint; MAP_PRIVATE|MAP_ANONYMOUS, /* flags */ -1, /* fd; ignored due to MAP_ANONYMOUS */ 0); /* offset; ignored due to MAP_ANONYMOUS */ + if (base==MAP_FAILED) + goto size_new_big; g_assert(base!=NULL); base+=PAGE_SIZE;