make compressed help code NOMMU- and NOFORK-friendly -

no forking anymore, bunzip2 unpack routine now does all it in memory.
This commit is contained in:
Denis Vlasenko
2007-04-10 21:40:19 +00:00
parent 335b63d8d1
commit c6758a07c6
11 changed files with 138 additions and 174 deletions

View File

@ -20,6 +20,15 @@
* Since dmalloc's prototypes overwrite the impls here as they are
* included after these prototypes in libbb.h, all is well.
*/
// Warn if we can't allocate size bytes of memory.
void *malloc_or_warn(size_t size)
{
void *ptr = malloc(size);
if (ptr == NULL && size != 0)
bb_error_msg(bb_msg_memory_exhausted);
return ptr;
}
// Die if we can't allocate size bytes of memory.
void *xmalloc(size_t size)
{