OSDN Git Service

2002-05-25 Robert Collins <rbtcollins@hotmail.com>
authorrbcollins <rbcollins>
Fri, 24 May 2002 14:24:31 +0000 (14:24 +0000)
committerrbcollins <rbcollins>
Fri, 24 May 2002 14:24:31 +0000 (14:24 +0000)
        * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.

winsup/cygwin/ChangeLog
winsup/cygwin/gmon.c

index cd682cb..e54c5b2 100644 (file)
@@ -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
index 95a7f43..048ef0d 100644 (file)
@@ -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