From 31b9bab65b95c6ccabff24b90fa80dc3a8344122 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 14 Sep 2009 01:58:13 +0000 Subject: * enable size tag in shm git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4842 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- common/bbs/cache.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common') diff --git a/common/bbs/cache.c b/common/bbs/cache.c index a23326bd..e224e5f4 100644 --- a/common/bbs/cache.c +++ b/common/bbs/cache.c @@ -104,6 +104,12 @@ attach_SHM(void) "or use ipcrm(1) command to clean share memory.\n"); exit(1); } + if(SHM->size != sizeof(SHM_t)) { + fprintf(stderr, "Error: SHM->size(%d) != sizeof(SHM_t)(%d)\n", SHM->size, sizeof(SHM_t)); + fprintf(stderr, "Please use the configuration corresponding to SHM,\n" + "or use ipcrm(1) command to clean share memory.\n"); + exit(1); + } if (!SHM->loaded) /* (uhash) assume fresh shared memory is * zeroed */ exit(1); -- cgit v1.2.3