From 229a2b3040a479ccc6052fe6d6c464fe301151c9 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sat, 30 Jan 1999 05:29:56 +0000 Subject: Sat Jan 30 00:27:14 1999 Thomas Bushnell, BSG * munge.c (create_queue): Make sure that malloc succeeds. Reported by OKUJI Yoshinori . --- term/ChangeLog | 5 +++++ term/main.c | 2 ++ term/munge.c | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'term') diff --git a/term/ChangeLog b/term/ChangeLog index f3aee05e..88ae64c9 100644 --- a/term/ChangeLog +++ b/term/ChangeLog @@ -1,3 +1,8 @@ +Sat Jan 30 00:27:14 1999 Thomas Bushnell, BSG + + * munge.c (create_queue): Make sure that malloc succeeds. + Reported by OKUJI Yoshinori . + 1998-10-24 Roland McGrath * users.c (open_hook): Assert DTR if NO_CARRIER, even for CLOCAL. diff --git a/term/main.c b/term/main.c index 10ed9eef..d14c7c48 100644 --- a/term/main.c +++ b/term/main.c @@ -172,7 +172,9 @@ main (int argc, char **argv) term_mode = (bottom == &ptyio_bottom ? 0666 : 0600) | S_IFCHR | S_IROOT; inputq = create_queue (256, QUEUE_LOWAT, QUEUE_HIWAT); + rawq = create_queue (256, QUEUE_LOWAT, QUEUE_HIWAT); + outputq = create_queue (256, QUEUE_LOWAT, QUEUE_HIWAT); if (bottom == &ptyio_bottom) diff --git a/term/munge.c b/term/munge.c index 653d32ba..f9cb5d72 100644 --- a/term/munge.c +++ b/term/munge.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -713,12 +713,16 @@ create_queue (int size, int lowat, int hiwat) struct queue *q; q = malloc (sizeof (struct queue) + size * sizeof (quoted_char)); + assert (q); + q->susp = 0; q->lowat = lowat; q->hiwat = hiwat; q->cs = q->ce = q->array; q->arraylen = size; q->wait = malloc (sizeof (struct condition)); + assert (q->wait); + condition_init (q->wait); return q; } -- cgit v1.2.3