From 0cd4c8ae6c1be12dd8cf91973760fb78ec9ee35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 25 May 2006 20:05:28 +0000 Subject: [PATCH] Enabled sbrk() again, but only for actual increments. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17592 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/unistd/sbrk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/posix/unistd/sbrk.c b/src/system/libroot/posix/unistd/sbrk.c index b0603d5acf..5c57b907b2 100644 --- a/src/system/libroot/posix/unistd/sbrk.c +++ b/src/system/libroot/posix/unistd/sbrk.c @@ -15,8 +15,12 @@ extern void *(*sbrk_hook)(long); void * sbrk(long increment) { -// TODO: disabled for now - let's GDB crash, so it obviously doesn't work yet -// if (sbrk_hook) -// return (*sbrk_hook)(increment); + // TODO: we only support extending the heap for now using this method + if (increment <= 0) + return NULL; + + if (sbrk_hook) + return (*sbrk_hook)(increment); + return NULL; }