]> git.ozlabs.org Git - ccan/blobdiff - ccan/antithread/antithread.c
antithread: correctly list ccan/typesafe_cb as dependency.
[ccan] / ccan / antithread / antithread.c
index 61b288a36bc11c61a6853d076b4f1b5d06c3f95f..72e172b1a244d82bd6e503510943eaf155091691 100644 (file)
@@ -1,3 +1,4 @@
+/* Licensed under GPLv3+ - see LICENSE file for details */
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -6,14 +7,15 @@
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <signal.h>
 #include <errno.h>
 #include <assert.h>
-#include <err.h>
 #include "antithread.h"
+#include <ccan/err/err.h>
 #include <ccan/noerr/noerr.h>
 #include <ccan/talloc/talloc.h>
 #include <ccan/read_write_all/read_write_all.h>
-#include <ccan/alloc/alloc.h>
+#include <ccan/antithread/alloc/alloc.h>
 #include <ccan/list/list.h>
 
 /* FIXME: Valgrind support should be possible for some cases.  Tricky
@@ -193,7 +195,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 +422,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;