patch-1.3.58 linux/drivers/char/tty_io.c

Next file: linux/drivers/char/wd501p.h
Previous file: linux/drivers/char/tpqic02.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.57/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -73,6 +73,10 @@
 #include "vt_kern.h"
 #include "selection.h"
 
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif
+
 #define CONSOLE_DEV MKDEV(TTY_MAJOR,0)
 #define TTY_DEV MKDEV(TTYAUX_MAJOR,0)
 
@@ -211,8 +215,17 @@
 	int	retval = 0;
 	struct	tty_ldisc o_ldisc;
 
-	if ((ldisc < N_TTY) || (ldisc >= NR_LDISCS) ||
-	    !(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED))
+	if ((ldisc < N_TTY) || (ldisc >= NR_LDISCS))
+		return -EINVAL;
+#ifdef CONFIG_KERNELD
+	/* Eduardo Blanco <ejbs@cs.cs.com.uy> */
+	if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) {
+		char modname [20];
+		sprintf(modname, "tty-ldisc-%d", ldisc);
+		request_module (modname);
+	}
+#endif
+	if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED))
 		return -EINVAL;
 
 	if (tty->ldisc.num == ldisc)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this