* cygheap.cc (_csbrk): Don't request zero bytes from VirtualAlloc,

as windows treats that as an invalid parameter and returns an error.
This commit is contained in:
Dave Korn 2007-12-11 15:16:19 +00:00
parent 4b93ac1f7f
commit 3623cfa399
2 changed files with 6 additions and 1 deletions

View 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

View 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))