summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/tty.c15
-rw-r--r--sys/sys/tty.h4
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 46c15c6..fca46ba 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.119 1999/05/22 20:10:31 dt Exp $
+ * $Id: tty.c,v 1.120 1999/08/08 19:47:31 phk Exp $
*/
/*-
@@ -2407,25 +2407,22 @@ ttysleep(tp, chan, pri, wmesg, timo)
return (tp->t_gen == gen ? 0 : ERESTART);
}
-#ifdef notyet
-/*
- * XXX this is usable not useful or used. Most tty drivers have
- * ifdefs for using ttymalloc() but assume a different interface.
- */
/*
* Allocate a tty struct. Clists in the struct will be allocated by
* ttyopen().
*/
struct tty *
-ttymalloc()
+ttymalloc(tp)
+ struct tty *tp;
{
- struct tty *tp;
+ if (tp)
+ return(tp);
tp = malloc(sizeof *tp, M_TTYS, M_WAITOK);
bzero(tp, sizeof *tp);
+ ttyregister(tp);
return (tp);
}
-#endif
#if 0 /* XXX not yet usable: session leader holds a ref (see kern_exit.c). */
/*
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index cedfa63..8da94c0 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
- * $Id: tty.h,v 1.44 1998/11/11 10:56:07 truckman Exp $
+ * $Id: tty.h,v 1.45 1999/08/08 19:47:26 phk Exp $
*/
#ifndef _SYS_TTY_H_
@@ -268,7 +268,7 @@ void ttyregister __P((struct tty *tp));
int ttysleep __P((struct tty *tp,
void *chan, int pri, char *wmesg, int timeout));
int ttywait __P((struct tty *tp));
-struct tty *ttymalloc __P((void));
+struct tty *ttymalloc __P((struct tty *tp));
void ttyfree __P((struct tty *));
#endif /* KERNEL */
OpenPOWER on IntegriCloud