[Devel] [PATCH] get_pagesize(): init var @ declaration and simplify

Igor Podlesny openvz at poige.ru
Tue May 7 21:54:39 PDT 2013


---
 src/lib/util.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lib/util.c b/src/lib/util.c
index febb676..19884c9 100644
--- a/src/lib/util.c
+++ b/src/lib/util.c
@@ -472,11 +472,10 @@ char *subst_VEID(envid_t veid, char *src)
 
 int get_pagesize()
 {
-	long pagesize;
+	long pagesize = sysconf(_SC_PAGESIZE);
 
-	if ((pagesize = sysconf(_SC_PAGESIZE)) == -1) {
+	if (pagesize == -1) {
 		logger(-1, errno, "Unable to get page size");
-		return -1;
 	}
 	return pagesize;
 }
-- 
1.7.9.5




More information about the Devel mailing list