On 05/06/2013 11:42 PM, Igor Podlesny wrote:
---
  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) {

No yoda conditions please. Compiler is smart enough
to warn if we accidentally use = instead of ==

                logger(-1, errno, "Unable to get page size");
-               return -1;
        }
        return pagesize;
  }

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to