Syncs up Makeconfig and the Makelocal.template
[akaros.git] / tools / compilers / gcc-glibc / glibc-2.11.1-ros / sysdeps / ros / sbrk.c
index 8eeb40e..2a58301 100644 (file)
@@ -46,16 +46,18 @@ __internal_setbrk (uintptr_t addr)
     if(real_new_brk > BRK_END)
       return -1;
 
-    return mmap((void*)real_brk, real_new_brk-real_brk,
-                PROT_READ | PROT_WRITE | PROT_EXEC,
-                MAP_FIXED | MAP_ANONYMOUS, -1, 0) == (void*)real_brk ? 0 : -1;
+    if (mmap((void*)real_brk, real_new_brk-real_brk,
+             PROT_READ | PROT_WRITE | PROT_EXEC,
+             MAP_FIXED | MAP_ANONYMOUS, -1, 0) != (void*)real_brk)
+      return -1;
   }
   else if(real_new_brk < real_brk)
   {
     if(real_new_brk < (uintptr_t)__procinfo.heap_bottom)
       return -1;
 
-    return munmap((void*)real_new_brk, real_brk - real_new_brk);
+    if (munmap((void*)real_new_brk, real_brk - real_new_brk))
+      return -1;
   }
 
   curbrk = addr;