X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fantithread%2Fantithread.c;h=f077221ed444305a12dbde2d4a1d54a2208a8be2;hp=61b288a36bc11c61a6853d076b4f1b5d06c3f95f;hb=f6900d2358ca0ec2f2dc776b9e42e4fca7bffbdf;hpb=387d15092e7f24d7f6014cea43e0c4f7922464de diff --git a/ccan/antithread/antithread.c b/ccan/antithread/antithread.c index 61b288a3..f077221e 100644 --- a/ccan/antithread/antithread.c +++ b/ccan/antithread/antithread.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -193,7 +194,7 @@ struct at_pool *at_pool(unsigned long size) /* Then we remap into the middle of it. */ munmap(p->pool, size+PADDING); - p->pool = mmap(p->pool + PADDING/2, size, PROT_READ|PROT_WRITE, + p->pool = mmap((char *)p->pool + PADDING/2, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (p->pool == MAP_FAILED) goto fail_free; @@ -420,7 +421,7 @@ struct at_pool *at_get_pool(int *argc, char *argv[], void **arg) p = atp->p = talloc(atp, struct at_pool_contents); - if (sscanf(argv[1], "AT:%p/%lu/%i/%i/%i/%p", + if (sscanf(argv[1], "AT:%p/%lu/%i/%i/%i/%p", &p->pool, &p->poolsize, &p->fd, &p->parent_rfd, &p->parent_wfd, arg) != 6) { errno = EINVAL;