[Devel] [PATCH 06/10] get_pagesize(): init var @ declaration and simplify
Igor Podlesny
openvz at poige.ru
Mon May 6 23:42:08 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..9d8912e 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 (-1 == pagesize) {
logger(-1, errno, "Unable to get page size");
- return -1;
}
return pagesize;
}
--
1.7.9.5
More information about the Devel
mailing list