From 42a3a87f134e8912f9704133bcd1c97086b30ec0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 1 Mar 2017 21:50:26 +0100 Subject: [PATCH] util/HugeAllocator: paranoid check for sysconf()<0 Just in case. --- src/util/HugeAllocator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/HugeAllocator.cxx b/src/util/HugeAllocator.cxx index 09a183831..67fba1c6d 100644 --- a/src/util/HugeAllocator.cxx +++ b/src/util/HugeAllocator.cxx @@ -48,7 +48,7 @@ static size_t AlignToPageSize(size_t size) { static const long page_size = sysconf(_SC_PAGESIZE); - if (page_size == 0) + if (page_size <= 0) return size; size_t ps(page_size);