r4563 - in trunk/varnish-cache: bin/varnishd lib/libvarnishapi
phk at projects.linpro.no
phk at projects.linpro.no
Tue Feb 16 22:06:09 CET 2010
Author: phk
Date: 2010-02-16 22:06:09 +0100 (Tue, 16 Feb 2010)
New Revision: 4563
Modified:
trunk/varnish-cache/bin/varnishd/shmlog.c
trunk/varnish-cache/bin/varnishd/storage_persistent.c
trunk/varnish-cache/lib/libvarnishapi/shmlog.c
Log:
Void* cast for mmap() and friends for portability (solaris).
Modified: trunk/varnish-cache/bin/varnishd/shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/shmlog.c 2010-02-16 21:05:08 UTC (rev 4562)
+++ trunk/varnish-cache/bin/varnishd/shmlog.c 2010-02-16 21:06:09 UTC (rev 4563)
@@ -401,13 +401,13 @@
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;
Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2010-02-16 21:05:08 UTC (rev 4562)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2010-02-16 21:06:09 UTC (rev 4563)
@@ -295,7 +295,7 @@
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));
Modified: trunk/varnish-cache/lib/libvarnishapi/shmlog.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2010-02-16 21:05:08 UTC (rev 4562)
+++ trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2010-02-16 21:06:09 UTC (rev 4563)
@@ -160,7 +160,7 @@
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 @@
{
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));
More information about the varnish-commit
mailing list