From 7bb4d900b67823982ac224e351c16c200c741686 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 29 May 1994 07:50:11 +0000 Subject: [PATCH] Don't panic if we can't malloc a cblock...just print a console message and be happy. --- sys/kern/subr_clist.c | 6 ++++-- sys/kern/tty_subr.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index 7ce49c4d24ad..d0b14966d25f 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -92,8 +92,10 @@ cblock_alloc_cblocks(number) for (i = 0; i < number; ++i) { tmp = malloc(sizeof(struct cblock), M_TTYS, M_NOWAIT); - if (!tmp) - panic("clist_init: could not allocate cblock"); + if (!tmp) { + printf("cblock_alloc_cblocks: could not malloc cblock"); + break; + } bzero((char *)tmp, sizeof(struct cblock)); cblock_free(tmp); } diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 7ce49c4d24ad..d0b14966d25f 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -92,8 +92,10 @@ cblock_alloc_cblocks(number) for (i = 0; i < number; ++i) { tmp = malloc(sizeof(struct cblock), M_TTYS, M_NOWAIT); - if (!tmp) - panic("clist_init: could not allocate cblock"); + if (!tmp) { + printf("cblock_alloc_cblocks: could not malloc cblock"); + break; + } bzero((char *)tmp, sizeof(struct cblock)); cblock_free(tmp); }