diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f97f3ffe1..e358f7003 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2007-12-11 Dave Korn + + * 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 * localtime.cc (tzset): Call tzsetwall only if it hasn't been diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index b9f24eecc..23e193bc3 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -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))