summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygheap.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-07-09 01:33:06 +0000
committerChristopher Faylor <me@cgf.cx>2003-07-09 01:33:06 +0000
commit4d782b426a09120642906e12e21bf669b7bb77db (patch)
tree514a0f6f1034d3bf897b6f7d7c365779fa40c44b /winsup/cygwin/cygheap.cc
parenta42408549f7b286dda7f333b5b977caf67fc1cdd (diff)
downloadcygnal-4d782b426a09120642906e12e21bf669b7bb77db.tar.gz
cygnal-4d782b426a09120642906e12e21bf669b7bb77db.tar.bz2
cygnal-4d782b426a09120642906e12e21bf669b7bb77db.zip
* cygheap.cc (creturn): Set appropriate errno when out of memory.
(ccalloc): Only issue system_printf when debugging. * dtable.cc (dtable::extend): Only allocate 100 * the incremental growth size max. Set errno appropriately. (dtable::build_fhandler): Check for error from set_name. * fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM. * fhandler.h (fhandler_base::set_name): Change to bool. * fhandler_process.cc (format_process_stat): Fix formatting. * resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size. * sysconf.cc (sysconf): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index aa213cc45..c79b0017c 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -285,7 +285,7 @@ creturn (cygheap_types x, cygheap_entry * c, unsigned len)
{
if (!c)
{
- __seterrno ();
+ set_errno (ENOMEM);
return NULL;
}
c->type = x;
@@ -348,8 +348,10 @@ ccalloc (cygheap_types x, DWORD n, DWORD size)
c = (cygheap_entry *) _cmalloc (sizeof_cygheap (n));
if (c)
memset (c->data, 0, n);
+#ifdef DEBUGGING
if (!c)
system_printf ("ccalloc returned NULL");
+#endif
return creturn (x, c, n);
}