From: phk Date: Sat, 19 Aug 2006 19:46:32 +0000 (+0000) Subject: Don't re-mmap the shmlog in the child, we already did it in the management X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b894cd9ce43ee6c758cdca1110afe43e35bd36c;p=varnish Don't re-mmap the shmlog in the child, we already did it in the management process and the inherited copy is perfectly fine to use. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@834 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/shmlog.c b/varnish-cache/bin/varnishd/shmlog.c index dbb344f4..0c08980d 100644 --- a/varnish-cache/bin/varnishd/shmlog.c +++ b/varnish-cache/bin/varnishd/shmlog.c @@ -124,19 +124,12 @@ void VSL_Init(void) { - loghead = mmap(NULL, heritage.vsl_size, - PROT_READ|PROT_WRITE, - MAP_HASSEMAPHORE | MAP_NOSYNC | MAP_SHARED, - heritage.vsl_fd, 0); - assert(loghead != MAP_FAILED); - assert(loghead->magic == SHMLOGHEAD_MAGIC); assert(loghead->hdrsize == sizeof *loghead); - /* XXX check sanity of loghead */ + /* XXX more check sanity of loghead ? */ logstart = (unsigned char *)loghead + loghead->start; AZ(pthread_mutex_init(&vsl_mutex, NULL)); loghead->starttime = time(NULL); - VSL_stats = &loghead->stats; memset(VSL_stats, 0, sizeof *VSL_stats); } @@ -181,9 +174,10 @@ VSL_MgtInit(const char *fn, unsigned size) } heritage.vsl_size = slh.size + slh.start; - /* - * Call VSL_Init so that we get a VSL_stats pointer in the - * management process as well. - */ - VSL_Init(); + loghead = mmap(NULL, heritage.vsl_size, + PROT_READ|PROT_WRITE, + MAP_HASSEMAPHORE | MAP_NOSYNC | MAP_SHARED, + heritage.vsl_fd, 0); + assert(loghead != MAP_FAILED); + VSL_stats = &loghead->stats; }