]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygheap.cc (_csbrk): Don't request zero bytes from VirtualAlloc,
authorDave Korn <dave.korn.cygwin@gmail.com>
Tue, 11 Dec 2007 15:16:19 +0000 (15:16 +0000)
committerDave Korn <dave.korn.cygwin@gmail.com>
Tue, 11 Dec 2007 15:16:19 +0000 (15:16 +0000)
as windows treats that as an invalid parameter and returns an error.

winsup/cygwin/ChangeLog
winsup/cygwin/cygheap.cc

index f97f3ffe11af2bc4474c83680eb5079c1078a239..e358f7003a875ab4d0cf209067b8e66b336e53b1 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-11  Dave Korn  <dave.korn@artimi.com>
+
+       * cygheap.cc (_csbrk):  Don't request zero bytes from VirtualAlloc,
+       as windows treats that as an invalid parameter and returns an error.
+
 2007-12-11  Corinna Vinschen  <corinna@vinschen.de>
 
        * localtime.cc (tzset): Call tzsetwall only if it hasn't been
index b9f24eecc7fa8e1880b36398e44eb82a76133018..23e193bc3c1d9632233a3c0a7b477e590313a23f 100644 (file)
@@ -129,7 +129,7 @@ _csbrk (int sbs)
        newbase = _cygheap_end;
 
       DWORD adjsbs = allocsize ((char *) cygheap_max - newbase);
-      if (!VirtualAlloc (newbase, adjsbs, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
+      if (adjsbs && !VirtualAlloc (newbase, adjsbs, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
        {
          MEMORY_BASIC_INFORMATION m;
          if (!VirtualQuery (newbase, &m, sizeof m))
This page took 0.03604 seconds and 5 git commands to generate.