diff options
author | Robert Collins <rbtcollins@hotmail.com> | 2002-05-24 18:24:33 +0400 |
---|---|---|
committer | Robert Collins <rbtcollins@hotmail.com> | 2002-05-24 18:24:33 +0400 |
commit | a6247be9986e27081594c4ef6300c14354a31616 (patch) | |
tree | 0be0bbca0ca6cfd1076a90ef4dcf088453f3eecf /winsup/cygwin | |
parent | ff938546975d416cf33466f54f80ec1b37e2693c (diff) |
2002-05-25 Robert Collins <rbtcollins@hotmail.com>
* gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/gmon.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cd682cbe8..e54c5b2b1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2002-05-25 Robert Collins <rbtcollins@hotmail.com> + + * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's. + 2002-05-24 Christopher Faylor <cgf@redhat.com> * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path diff --git a/winsup/cygwin/gmon.c b/winsup/cygwin/gmon.c index 95a7f430e..048ef0df1 100644 --- a/winsup/cygwin/gmon.c +++ b/winsup/cygwin/gmon.c @@ -44,6 +44,7 @@ static char rcsid[] = "$OpenBSD: gmon.c,v 1.8 1997/07/23 21:11:27 kstailey Exp $ #include <gmon.h> #include <profil.h> +#include <windows.h> /* XXX needed? */ //extern char *minbrk __asm ("minbrk"); @@ -61,7 +62,11 @@ void moncontrol __P((int)); static void * fake_sbrk(int size) { - return malloc(size); + void *rv = malloc(size); + if (rv) + return rv; + else + return (void *) -1; } void |