* 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.
This commit is contained in:
Christopher Faylor
2003-07-09 01:33:06 +00:00
parent a42408549f
commit 4d782b426a
8 changed files with 64 additions and 26 deletions

View File

@@ -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);
}