diff options
author | Christopher Faylor <me@cgf.cx> | 2005-08-24 04:38:39 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-08-24 04:38:39 +0000 |
commit | 14c4d65ef1240b1c18db06c3030b4e0830b0c701 (patch) | |
tree | 0a651de83d4520bb1c08dd334792733560733975 /winsup/cygwin/fhandler_virtual.cc | |
parent | db7f135b03afa5f8ee870f87d1727d69dade30ce (diff) | |
download | cygnal-14c4d65ef1240b1c18db06c3030b4e0830b0c701.tar.gz cygnal-14c4d65ef1240b1c18db06c3030b4e0830b0c701.tar.bz2 cygnal-14c4d65ef1240b1c18db06c3030b4e0830b0c701.zip |
* cygheap.h (cygheap_types): Add HEAP_COMMUNE.
* fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf
throughout.
* fhandler_registry.cc: Ditto.
* fhandler_virtual.cc: Ditto.
* fhandler_process.cc: Ditto.
(get_mem_values): Use malloc/realloc/free rather than new.
* pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user
heap. Avoid calling ReadFile when correct number of characters have been read
or suffer buffer corruption.
(_pinfo::fd): Allocate on cygwin heap rather than user heap.
(_pinfo::fds): Ditto.
(_pinfo::root): Ditto.
(_pinfo::cwd): Ditto.
(_pinfo::cmdline): Ditto.
* devices.h (FH_DEV): New define.
* devices.in: Detect lone /dev.
* devices.cc: Regenerate.
* path.cc (path_conv::check): Treat FH_DEV as a special case.
Diffstat (limited to 'winsup/cygwin/fhandler_virtual.cc')
-rw-r--r-- | winsup/cygwin/fhandler_virtual.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_virtual.cc b/winsup/cygwin/fhandler_virtual.cc index 9afc1d760..ab078d616 100644 --- a/winsup/cygwin/fhandler_virtual.cc +++ b/winsup/cygwin/fhandler_virtual.cc @@ -33,14 +33,15 @@ fhandler_virtual::fhandler_virtual (): fhandler_virtual::~fhandler_virtual () { if (filebuf) - free (filebuf); - filebuf = NULL; + { + cfree (filebuf); + filebuf = NULL; + } } void fhandler_virtual::fixup_after_exec () { - close (); } DIR * @@ -154,7 +155,7 @@ fhandler_virtual::dup (fhandler_base * child) if (!ret) { fhandler_virtual *fhproc_child = (fhandler_virtual *) child; - fhproc_child->filebuf = (char *) malloc (filesize); + fhproc_child->filebuf = (char *) cmalloc (HEAP_BUF, filesize); fhproc_child->bufalloc = fhproc_child->filesize = filesize; fhproc_child->position = position; memcpy (fhproc_child->filebuf, filebuf, filesize); @@ -168,8 +169,7 @@ fhandler_virtual::close () { if (!hExeced) { - if (filebuf) - free (filebuf); + cfree (filebuf); filebuf = NULL; bufalloc = (size_t) -1; } |