Commit 3670ad6d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make sure complaints from (je)malloc aren't lost, at least on FreeBSD.

parent 6ca1aef1
......@@ -188,6 +188,16 @@ static struct cli_proto debug_cmds[] = {
* XXX: Think more about which order we start things
*/
#ifdef __FreeBSD__
static void
child_malloc_fail(void *p, const char *s)
{
VSL(SLT_Error, 0, "MALLOC ERROR: %s (%p)", s, p);
fprintf(stderr, "MALLOC ERROR: %s (%p)\n", s, p);
WRONG("Malloc Error");
}
#endif
void
child_main(void)
{
......@@ -195,6 +205,9 @@ child_main(void)
setbuf(stdout, NULL);
setbuf(stderr, NULL);
printf("Child starts\n");
#ifdef __FreeBSD__
malloc_message = child_malloc_fail;
#endif
cache_param = heritage.param;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment