* cygheap.cc (_csbrk): More left coercion cleanup.

* fhandler_tty.cc (fhandler_tty_slave::read): Ditto.
(fhandler_tty_slave::write): Ditto.
* fhandler_windows.cc (fhandler_windows::read): Ditto.
* heap.cc (sbrk): Ditto.
This commit is contained in:
Christopher Faylor
2003-09-07 18:27:54 +00:00
parent ed2287adcd
commit bd8938985e
5 changed files with 15 additions and 7 deletions

View File

@@ -179,14 +179,14 @@ _csbrk (int sbs)
{
void *prebrk = cygheap_max;
void *prebrka = pagetrunc (prebrk);
(char *) cygheap_max += sbs;
cygheap_max = (char *) cygheap_max + sbs;
if (!sbs || (prebrk != prebrka && prebrka == pagetrunc (cygheap_max)))
/* nothing to do */;
else if (!VirtualAlloc (prebrk, (DWORD) sbs, MEM_COMMIT, PAGE_READWRITE))
{
malloc_printf ("couldn't commit memory for cygwin heap, %E");
__seterrno ();
(char *) cygheap_max -= sbs;
cygheap_max = (char *) cygheap_max - sbs;
return NULL;
}