From: Cody P Schafer Date: Sun, 16 Aug 2015 22:58:32 +0000 (-0400) Subject: talloc: avoid a comparison mismatch & at the same time switch to non-legacy sysconf() X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=426bd7e6844f1f01637facaba087f78a5a1d530a talloc: avoid a comparison mismatch & at the same time switch to non-legacy sysconf() Without this, gcc warns about a sign mismatch in the comparison. Signed-off-by: Cody P Schafer Signed-off-by: Rusty Russell --- diff --git a/ccan/talloc/talloc.c b/ccan/talloc/talloc.c index 0c6bcda9..3ada60fc 100644 --- a/ccan/talloc/talloc.c +++ b/ccan/talloc/talloc.c @@ -810,7 +810,7 @@ void *_talloc(const void *context, size_t size) static int talloc_destroy_pointer(void ***pptr) { - if ((uintptr_t)**pptr < getpagesize()) + if ((uintptr_t)**pptr < (uintptr_t)sysconf(_SC_PAGESIZE)) TALLOC_ABORT("Double free or invalid talloc_set?"); /* Invalidate pointer so it can't be used again. */ **pptr = (void *)1;