From 426bd7e6844f1f01637facaba087f78a5a1d530a Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 16 Aug 2015 18:58:32 -0400 Subject: [PATCH] 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 --- ccan/talloc/talloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5