Commit c3c9785f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Void* cast for mmap() and friends for portability (solaris).



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4563 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a5bfd5f1
......@@ -401,13 +401,13 @@ VSL_MgtInit(const char *fn, unsigned size)
vsl_buildnew(fn, size);
}
loghead = mmap(NULL, heritage.vsl_size,
loghead = (void *)mmap(NULL, heritage.vsl_size,
PROT_READ|PROT_WRITE,
MAP_HASSEMAPHORE | MAP_NOSYNC | MAP_SHARED,
heritage.vsl_fd, 0);
loghead->master_pid = getpid();
xxxassert(loghead != MAP_FAILED);
(void)mlock(loghead, heritage.vsl_size);
(void)mlock((void*)loghead, heritage.vsl_size);
VSL_stats = &loghead->stats;
pp = (void *)(loghead + 1);
*pp = *params;
......
......@@ -295,7 +295,7 @@ smp_sync_sign(const struct smp_signctx *ctx)
int i;
/* XXX: round to pages */
i = msync(ctx->ss, ctx->ss->length + SHA256_LEN, MS_SYNC);
i = msync((void*)ctx->ss, ctx->ss->length + SHA256_LEN, MS_SYNC);
if (i && 0)
fprintf(stderr, "SyncSign(%p %s) = %d %s\n",
ctx->ss, ctx->id, i, strerror(errno));
......
......@@ -160,7 +160,7 @@ vsl_shmem_map(const char *varnish_name)
return (1);
}
vsl_lh = mmap(NULL, slh.size + sizeof slh,
vsl_lh = (void *)mmap(NULL, slh.size + sizeof slh,
PROT_READ, MAP_SHARED|MAP_HASSEMAPHORE, vsl_fd, 0);
if (vsl_lh == MAP_FAILED) {
fprintf(stderr, "Cannot mmap %s: %s\n",
......@@ -590,7 +590,7 @@ VSL_Close(void)
{
if (vsl_lh == NULL)
return;
assert(0 == munmap(vsl_lh, vsl_lh->size + sizeof *vsl_lh));
assert(0 == munmap((void*)vsl_lh, vsl_lh->size + sizeof *vsl_lh));
vsl_lh = NULL;
assert(vsl_fd >= 0);
assert(0 == close(vsl_fd));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment